pub trait MulAssign<Rhs = Self> {
// Required method
fn mul_assign(&mut self, rhs: Rhs);
}
Expand description
The multiplication assignment operator *=
.
§Examples
use std::ops::MulAssign;
#[derive(Debug, PartialEq)]
struct Frequency { hertz: f64 }
impl MulAssign<f64> for Frequency {
fn mul_assign(&mut self, rhs: f64) {
self.hertz *= rhs;
}
}
let mut frequency = Frequency { hertz: 50.0 };
frequency *= 4.0;
assert_eq!(Frequency { hertz: 200.0 }, frequency);
Required Methods§
1.8.0 · Sourcefn mul_assign(&mut self, rhs: Rhs)
fn mul_assign(&mut self, rhs: Rhs)
Implementors§
impl MulAssign for f16
impl MulAssign for f32
impl MulAssign for f64
impl MulAssign for f128
impl MulAssign for i8
impl MulAssign for i16
impl MulAssign for i32
impl MulAssign for i64
impl MulAssign for i128
impl MulAssign for isize
impl MulAssign for u8
impl MulAssign for u16
impl MulAssign for u32
impl MulAssign for u64
impl MulAssign for u128
impl MulAssign for usize
impl MulAssign for Saturating<i8>
impl MulAssign for Saturating<i16>
impl MulAssign for Saturating<i32>
impl MulAssign for Saturating<i64>
impl MulAssign for Saturating<i128>
impl MulAssign for Saturating<isize>
impl MulAssign for Saturating<u8>
impl MulAssign for Saturating<u16>
impl MulAssign for Saturating<u32>
impl MulAssign for Saturating<u64>
impl MulAssign for Saturating<u128>
impl MulAssign for Saturating<usize>
impl MulAssign for Wrapping<i8>
impl MulAssign for Wrapping<i16>
impl MulAssign for Wrapping<i32>
impl MulAssign for Wrapping<i64>
impl MulAssign for Wrapping<i128>
impl MulAssign for Wrapping<isize>
impl MulAssign for Wrapping<u8>
impl MulAssign for Wrapping<u16>
impl MulAssign for Wrapping<u32>
impl MulAssign for Wrapping<u64>
impl MulAssign for Wrapping<u128>
impl MulAssign for Wrapping<usize>
impl MulAssign for BigInt
impl MulAssign for BigUint
impl MulAssign for I8
Warning: has wrapping semantics.
impl MulAssign for I16
Warning: has wrapping semantics.
impl MulAssign for I32
Warning: has wrapping semantics.
impl MulAssign for I64
Warning: has wrapping semantics.
impl MulAssign for I128
Warning: has wrapping semantics.
impl MulAssign for U8
Warning: has wrapping semantics.
impl MulAssign for U16
Warning: has wrapping semantics.
impl MulAssign for U32
Warning: has wrapping semantics.
impl MulAssign for U64
Warning: has wrapping semantics.
impl MulAssign for U128
Warning: has wrapping semantics.