Trait grafix_toolbox::uses::ops::AddAssign 1.8.0[−][src]
pub trait AddAssign<Rhs = Self> {
fn add_assign(&mut self, rhs: Rhs);
}Expand description
The addition assignment operator +=.
Examples
This example creates a Point struct that implements the AddAssign
trait, and then demonstrates add-assigning to a mutable Point.
use std::ops::AddAssign; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl AddAssign for Point { fn add_assign(&mut self, other: Self) { *self = Self { x: self.x + other.x, y: self.y + other.y, }; } } let mut point = Point { x: 1, y: 0 }; point += Point { x: 2, y: 3 }; assert_eq!(point, Point { x: 3, y: 3 });
Required methods
fn add_assign(&mut self, rhs: Rhs)
fn add_assign(&mut self, rhs: Rhs)Implementations on Foreign Types
Implements the += operator for appending to a String.
This has the same behavior as the push_str method.
impl AddAssign<Point> for Point
impl AddAssign<Point> for Pointpub fn add_assign(&mut self, other: Point)
pub fn add_assign(&mut self, other: Point)let mut p1 = point(1.0, 2.0); p1 += point(2.0, 1.5); assert!((p1.x - 3.0).abs() <= core::f32::EPSILON); assert!((p1.y - 3.5).abs() <= core::f32::EPSILON);
impl<T> AddAssign<Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
impl<T> AddAssign<Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField, impl<'b, T> AddAssign<&'b Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
impl<'b, T> AddAssign<&'b Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField, impl<T> AddAssign<DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
impl<T> AddAssign<DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField, impl<'b, T, R1, C1, R2, C2, SA, SB> AddAssign<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
C2: Dim,
R1: Dim,
R2: Dim,
C1: Dim,
SA: StorageMut<T, R1, C1>,
SB: Storage<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
impl<'b, T, R1, C1, R2, C2, SA, SB> AddAssign<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
C2: Dim,
R1: Dim,
R2: Dim,
C1: Dim,
SA: StorageMut<T, R1, C1>,
SB: Storage<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>, impl<'b, T> AddAssign<&'b DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
impl<'b, T> AddAssign<&'b DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField, impl<T, R1, C1, R2, C2, SA, SB> AddAssign<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
C2: Dim,
R1: Dim,
R2: Dim,
C1: Dim,
SA: StorageMut<T, R1, C1>,
SB: Storage<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
impl<T, R1, C1, R2, C2, SA, SB> AddAssign<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
C2: Dim,
R1: Dim,
R2: Dim,
C1: Dim,
SA: StorageMut<T, R1, C1>,
SB: Storage<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>, pub fn add_assign(&mut self, rhs: AutoSimd<[i32; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i8; 32]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u8; 32]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u32; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[usize; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u16; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u128; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u16; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u16; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i64; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i8; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i64; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u8; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i32; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[isize; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f32; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i128; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i16; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u16; 32]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u128; 1]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u32; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[usize; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u16; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f64; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u8; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f32; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u32; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i16; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f64; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f32; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i32; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u32; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[isize; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i8; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i16; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[usize; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u64; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f32; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u8; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i128; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u64; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[isize; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i32; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i8; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[f64; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u8; 16]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i8; 8]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i16; 32]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u128; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i64; 2]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i128; 1]>)pub fn add_assign(&mut self, rhs: AutoSimd<[i16; 4]>)pub fn add_assign(&mut self, rhs: AutoSimd<[u64; 8]>)