Trait enso_prelude::Add 1.0.0[−][src]
Expand description
The addition operator +
.
Note that Rhs
is Self
by default, but this is not mandatory. For
example, std::time::SystemTime
implements Add<Duration>
, which permits
operations of the form SystemTime = SystemTime + Duration
.
Examples
Add
able points
use std::ops::Add; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl Add for Point { type Output = Self; fn add(self, other: Self) -> Self { Self { x: self.x + other.x, y: self.y + other.y, } } } assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, Point { x: 3, y: 3 });
Implementing Add
with generics
Here is an example of the same Point
struct implementing the Add
trait
using generics.
use std::ops::Add; #[derive(Debug, Copy, Clone, PartialEq)] struct Point<T> { x: T, y: T, } // Notice that the implementation uses the associated type `Output`. impl<T: Add<Output = T>> Add for Point<T> { type Output = Self; fn add(self, other: Self) -> Self::Output { Self { x: self.x + other.x, y: self.y + other.y, } } } assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, Point { x: 3, y: 3 });
Associated Types
Required methods
Implementations on Foreign Types
impl Add<Duration> for SystemTime
[src]
impl Add<Duration> for SystemTime
[src]pub fn add(self, dur: Duration) -> SystemTime
[src]
pub fn add(self, dur: Duration) -> SystemTime
[src]Panics
This function may panic if the resulting point in time cannot be represented by the
underlying data structure. See SystemTime::checked_add
for a version without panic.
type Output = SystemTime
impl<'_> Add<&'_ str> for String
[src]
impl<'_> Add<&'_ str> for String
[src]Implements the +
operator for concatenating two strings.
This consumes the String
on the left-hand side and re-uses its buffer (growing it if
necessary). This is done to avoid allocating a new String
and copying the entire contents on
every operation, which would lead to O(n^2) running time when building an n-byte string by
repeated concatenation.
The string on the right-hand side is only borrowed; its contents are copied into the returned
String
.
Examples
Concatenating two String
s takes the first by value and borrows the second:
let a = String::from("hello"); let b = String::from(" world"); let c = a + &b; // `a` is moved and can no longer be used here.
If you want to keep using the first String
, you can clone it and append to the clone instead:
let a = String::from("hello"); let b = String::from(" world"); let c = a.clone() + &b; // `a` is still valid here.
Concatenating &str
slices can be done by converting the first to a String
:
let a = "hello"; let b = " world"; let c = a.to_string() + b;
impl<'b, T> Add<&'b DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'b, T> Add<&'b DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn add(
self,
rhs: &'b DualQuaternion<T>
) -> <DualQuaternion<T> as Add<&'b DualQuaternion<T>>>::Output
[src]
self,
rhs: &'b DualQuaternion<T>
) -> <DualQuaternion<T> as Add<&'b DualQuaternion<T>>>::Output
impl<'b, T, D2, SB, const D1: usize> Add<&'b Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<'b, T, D2, SB, const D1: usize> Add<&'b Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<T> Add<Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Add<Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn add(
self,
rhs: Quaternion<T>
) -> <Quaternion<T> as Add<Quaternion<T>>>::Output
[src]
self,
rhs: Quaternion<T>
) -> <Quaternion<T> as Add<Quaternion<T>>>::Output
impl<'a, 'b, T> Add<&'b Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, 'b, T> Add<&'b Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn add(
self,
rhs: &'b Quaternion<T>
) -> <&'a Quaternion<T> as Add<&'b Quaternion<T>>>::Output
[src]
self,
rhs: &'b Quaternion<T>
) -> <&'a Quaternion<T> as Add<&'b Quaternion<T>>>::Output
impl<'b, T> Add<&'b Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'b, T> Add<&'b Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn add(
self,
rhs: &'b Quaternion<T>
) -> <Quaternion<T> as Add<&'b Quaternion<T>>>::Output
[src]
self,
rhs: &'b Quaternion<T>
) -> <Quaternion<T> as Add<&'b Quaternion<T>>>::Output
impl<'a, 'b, T, R1, C1, R2, C2, SA, SB> Add<&'b Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]
impl<'a, 'b, T, R1, C1, R2, C2, SA, SB> Add<&'b Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>
pub fn add(
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Add<&'b Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Add<&'b Matrix<T, R2, C2, SB>>>::Output
impl<'a, 'b, T> Add<&'b DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, 'b, T> Add<&'b DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn add(
self,
rhs: &'b DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Add<&'b DualQuaternion<T>>>::Output
[src]
self,
rhs: &'b DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Add<&'b DualQuaternion<T>>>::Output
impl<'a, T, D2, SB, const D1: usize> Add<Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<'a, T, D2, SB, const D1: usize> Add<Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<T, D2, SB, const D1: usize> Add<Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<T, D2, SB, const D1: usize> Add<Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<'a, T> Add<Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Add<Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn add(
self,
rhs: Quaternion<T>
) -> <&'a Quaternion<T> as Add<Quaternion<T>>>::Output
[src]
self,
rhs: Quaternion<T>
) -> <&'a Quaternion<T> as Add<Quaternion<T>>>::Output
impl<'a, T> Add<DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Add<DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn add(
self,
rhs: DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Add<DualQuaternion<T>>>::Output
[src]
self,
rhs: DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Add<DualQuaternion<T>>>::Output
impl<'a, T, R1, C1, R2, C2, SA, SB> Add<Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R2, C2, R1, C1>,
ShapeConstraint: SameNumberOfRows<R2, R1>,
ShapeConstraint: SameNumberOfColumns<C2, C1>,
[src]
impl<'a, T, R1, C1, R2, C2, SA, SB> Add<Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R2, C2, R1, C1>,
ShapeConstraint: SameNumberOfRows<R2, R1>,
ShapeConstraint: SameNumberOfColumns<C2, C1>,
[src]type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative, <DefaultAllocator as Allocator<T, <ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative>>::Buffer>
pub fn add(
self,
rhs: Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Add<Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Add<Matrix<T, R2, C2, SB>>>::Output
impl<T, R1, C1, R2, C2, SA, SB> Add<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]
impl<T, R1, C1, R2, C2, SA, SB> Add<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>
pub fn add(
self,
rhs: Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Add<Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Add<Matrix<T, R2, C2, SB>>>::Output
impl<T> Add<DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Add<DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn add(
self,
rhs: DualQuaternion<T>
) -> <DualQuaternion<T> as Add<DualQuaternion<T>>>::Output
[src]
self,
rhs: DualQuaternion<T>
) -> <DualQuaternion<T> as Add<DualQuaternion<T>>>::Output
impl<'a, 'b, T, D2, SB, const D1: usize> Add<&'b Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<'a, 'b, T, D2, SB, const D1: usize> Add<&'b Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedAdd<T>,
D2: Dim,
SB: Storage<T, D2, Const<1_usize>>,
ShapeConstraint: SameNumberOfRows<Const<D1>, D2>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D1>, D2>>::Representative == Const<D1>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<'b, T, R1, C1, R2, C2, SA, SB> Add<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]
impl<'b, T, R1, C1, R2, C2, SA, SB> Add<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedAdd<T>,
R2: Dim,
C2: Dim,
R1: Dim,
C1: Dim,
SB: Storage<T, R2, C2>,
SA: Storage<T, R1, C1>,
DefaultAllocator: SameShapeAllocator<T, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>
pub fn add(
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Add<&'b Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Add<&'b Matrix<T, R2, C2, SB>>>::Output
impl<U> Add<U> for UTerm where
U: Unsigned,
impl<U> Add<U> for UTerm where
U: Unsigned,
UTerm + U = U
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B1> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B1> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
UInt<Ul, B1> + UInt<Ur, B0> = UInt<Ul + Ur, B1>
impl Add<B0> for UTerm
impl Add<B0> for UTerm
UTerm + B0 = UTerm
impl<Ul, Ur> Add<PInt<Ur>> for NInt<Ul> where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero + Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>,
impl<Ul, Ur> Add<PInt<Ur>> for NInt<Ul> where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero + Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>,
N(Ul) + P(Ur)
: We resolve this with our PrivateAdd
impl Add<B1> for UTerm
impl Add<B1> for UTerm
UTerm + B1 = UInt<UTerm, B1>
impl Add<ATerm> for ATerm
impl Add<ATerm> for ATerm
impl<U> Add<Z0> for PInt<U> where
U: Unsigned + NonZero,
impl<U> Add<Z0> for PInt<U> where
U: Unsigned + NonZero,
PInt + Z0 = PInt
impl<I> Add<I> for Z0 where
I: Integer,
impl<I> Add<I> for Z0 where
I: Integer,
Z0 + I = I
impl<U, B> Add<B0> for UInt<U, B> where
U: Unsigned,
B: Bit,
impl<U, B> Add<B0> for UInt<U, B> where
U: Unsigned,
B: Bit,
U + B0 = U
impl<U> Add<B1> for UInt<U, B0> where
U: Unsigned,
impl<U> Add<B1> for UInt<U, B0> where
U: Unsigned,
UInt<U, B0> + B1 = UInt<U + B1>
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B0> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B0> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
UInt<Ul, B0> + UInt<Ur, B0> = UInt<Ul + Ur, B0>
impl<U> Add<B1> for UInt<U, B1> where
U: Unsigned + Add<B1>,
<U as Add<B1>>::Output: Unsigned,
impl<U> Add<B1> for UInt<U, B1> where
U: Unsigned + Add<B1>,
<U as Add<B1>>::Output: Unsigned,
UInt<U, B1> + B1 = UInt<U + B1, B0>
impl<Ul, Ur> Add<NInt<Ur>> for NInt<Ul> where
Ul: Unsigned + NonZero + Add<Ur>,
Ur: Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned,
<Ul as Add<Ur>>::Output: NonZero,
impl<Ul, Ur> Add<NInt<Ur>> for NInt<Ul> where
Ul: Unsigned + NonZero + Add<Ur>,
Ur: Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned,
<Ul as Add<Ur>>::Output: NonZero,
N(Ul) + N(Ur) = N(Ul + Ur)
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
UInt<Ul, B0> + UInt<Ur, B1> = UInt<Ul + Ur, B1>
impl<Ul, Ur> Add<NInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>,
Ur: Unsigned + NonZero,
impl<Ul, Ur> Add<NInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>,
Ur: Unsigned + NonZero,
P(Ul) + N(Ur)
: We resolve this with our PrivateAdd
impl<Ul, Ur> Add<PInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Add<Ur>,
Ur: Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned,
<Ul as Add<Ur>>::Output: NonZero,
impl<Ul, Ur> Add<PInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Add<Ur>,
Ur: Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned,
<Ul as Add<Ur>>::Output: NonZero,
P(Ul) + P(Ur) = P(Ul + Ur)
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B1> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
<Ul as Add<Ur>>::Output: Add<B1>,
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B1> where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
<Ul as Add<Ur>>::Output: Add<B1>,
UInt<Ul, B1> + UInt<Ur, B1> = UInt<(Ul + Ur) + B1, B0>
impl<U, B> Add<UTerm> for UInt<U, B> where
U: Unsigned,
B: Bit,
impl<U, B> Add<UTerm> for UInt<U, B> where
U: Unsigned,
B: Bit,
UInt<U, B> + UTerm = UInt<U, B>
impl<U> Add<Z0> for NInt<U> where
U: Unsigned + NonZero,
impl<U> Add<Z0> for NInt<U> where
U: Unsigned + NonZero,
NInt + Z0 = NInt