pub trait SliceAddAssign<T>: Slice<Item = T> {
// Required methods
const fn add_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: AddAssign<Rhs>,
Rhs: Copy;
const async fn add_assign_all_async<Rhs>(&mut self, rhs: Rhs)
where T: AddAssign<Rhs>,
Rhs: Copy;
}Required Methods§
Sourceconst fn add_assign_all<Rhs>(&mut self, rhs: Rhs)
const fn add_assign_all<Rhs>(&mut self, rhs: Rhs)
Adds rhs to each element in the slice.
§Example
use slice_ops::ops::*;
let mut x = [1, 2, 3, 4, 5, 6, 7, 8];
x.add_assign_all(2);
assert_eq!(x, [3, 4, 5, 6, 7, 8, 9, 10]);Sourceconst async fn add_assign_all_async<Rhs>(&mut self, rhs: Rhs)
const async fn add_assign_all_async<Rhs>(&mut self, rhs: Rhs)
Asynchronously adds rhs to each element in the slice.
§Example
use slice_ops::ops::*;
let mut x = [1, 2, 3, 4, 5, 6, 7, 8];
x.add_assign_all_async(2).await;
assert_eq!(x, [3, 4, 5, 6, 7, 8, 9, 10]);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.