pub trait SliceSubAssign<T>: Slice<Item = T> {
// Required methods
const fn sub_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: SubAssign<Rhs>,
Rhs: Copy;
const async fn sub_assign_all_async<Rhs>(&mut self, rhs: Rhs)
where T: SubAssign<Rhs>,
Rhs: Copy;
const fn rsub_assign_all<Lhs>(&mut self, lhs: Lhs)
where Lhs: Copy + Sub<T, Output = T>;
const async fn rsub_assign_all_async<Lhs>(&mut self, lhs: Lhs)
where Lhs: Copy + Sub<T, Output = T>;
}Required Methods§
Sourceconst fn sub_assign_all<Rhs>(&mut self, rhs: Rhs)
const fn sub_assign_all<Rhs>(&mut self, rhs: Rhs)
Subtracts each element in the slice by rhs.
§Example
use slice_ops::ops::*;
let mut x = [1, 2, 3, 4, 5, 6, 7, 8];
x.sub_assign_all(2);
assert_eq!(x, [-1, 0, 1, 2, 3, 4, 5, 6]);Sourceconst async fn sub_assign_all_async<Rhs>(&mut self, rhs: Rhs)
const async fn sub_assign_all_async<Rhs>(&mut self, rhs: Rhs)
Asynchronously subtracts each element in the slice by rhs.
§Example
use slice_ops::ops::*;
let mut x = [1, 2, 3, 4, 5, 6, 7, 8];
x.sub_assign_all_async(2).await;
assert_eq!(x, [-1, 0, 1, 2, 3, 4, 5, 6]);Sourceconst fn rsub_assign_all<Lhs>(&mut self, lhs: Lhs)
const fn rsub_assign_all<Lhs>(&mut self, lhs: Lhs)
TODO
Sourceconst async fn rsub_assign_all_async<Lhs>(&mut self, lhs: Lhs)
const async fn rsub_assign_all_async<Lhs>(&mut self, lhs: Lhs)
TODO
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.