pub trait SliceMulAssign<T>: Slice<Item = T> {
// Required methods
const fn mul_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: MulAssign<Rhs>,
Rhs: Copy;
const async fn mul_assign_all_async<Rhs>(&mut self, rhs: Rhs)
where T: MulAssign<Rhs>,
Rhs: Copy;
}
Required Methods§
Sourceconst fn mul_assign_all<Rhs>(&mut self, rhs: Rhs)
const fn mul_assign_all<Rhs>(&mut self, rhs: Rhs)
Multiplies rhs
to each element in the slice.
§Example
use slice_ops::ops::*;
let mut x = [1, 2, 3, 4, 5, 6, 7, 8];
x.mul_assign_all(2);
assert_eq!(x, [2, 4, 6, 8, 10, 12, 14, 16]);
Sourceconst async fn mul_assign_all_async<Rhs>(&mut self, rhs: Rhs)
const async fn mul_assign_all_async<Rhs>(&mut self, rhs: Rhs)
Asynchronously multiplies rhs
to each element in the slice.
§Example
use slice_ops::ops::*;
let mut x = [1, 2, 3, 4, 5, 6, 7, 8];
x.mul_assign_all_async(2).await;
assert_eq!(x, [2, 4, 6, 8, 10, 12, 14, 16]);
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.