Trait enso_prelude::Sub 1.0.0[−][src]
Expand description
The subtraction operator -
.
Note that Rhs
is Self
by default, but this is not mandatory. For
example, std::time::SystemTime
implements Sub<Duration>
, which permits
operations of the form SystemTime = SystemTime - Duration
.
Examples
Sub
tractable points
use std::ops::Sub; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl Sub for Point { type Output = Self; fn sub(self, other: Self) -> Self::Output { Self { x: self.x - other.x, y: self.y - other.y, } } } assert_eq!(Point { x: 3, y: 3 } - Point { x: 2, y: 3 }, Point { x: 1, y: 0 });
Implementing Sub
with generics
Here is an example of the same Point
struct implementing the Sub
trait
using generics.
use std::ops::Sub; #[derive(Debug, PartialEq)] struct Point<T> { x: T, y: T, } // Notice that the implementation uses the associated type `Output`. impl<T: Sub<Output = T>> Sub for Point<T> { type Output = Self; fn sub(self, other: Self) -> Self::Output { Point { x: self.x - other.x, y: self.y - other.y, } } } assert_eq!(Point { x: 2, y: 3 } - Point { x: 1, y: 0 }, Point { x: 1, y: 3 });
Associated Types
Required methods
Implementations on Foreign Types
impl Sub<Duration> for SystemTime
[src]
impl Sub<Duration> for SystemTime
[src]impl<'_, '_, T> Sub<&'_ BTreeSet<T>> for &'_ BTreeSet<T> where
T: Ord + Clone,
[src]
impl<'_, '_, T> Sub<&'_ BTreeSet<T>> for &'_ BTreeSet<T> where
T: Ord + Clone,
[src]pub fn sub(self, rhs: &BTreeSet<T>) -> BTreeSet<T>
[src]
pub fn sub(self, rhs: &BTreeSet<T>) -> BTreeSet<T>
[src]Returns the difference of self
and rhs
as a new BTreeSet<T>
.
Examples
use std::collections::BTreeSet; let a: BTreeSet<_> = vec![1, 2, 3].into_iter().collect(); let b: BTreeSet<_> = vec![3, 4, 5].into_iter().collect(); let result = &a - &b; let result_vec: Vec<_> = result.into_iter().collect(); assert_eq!(result_vec, [1, 2]);
impl<'b, T> Sub<&'b DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'b, T> Sub<&'b DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn sub(
self,
rhs: &'b DualQuaternion<T>
) -> <DualQuaternion<T> as Sub<&'b DualQuaternion<T>>>::Output
[src]
self,
rhs: &'b DualQuaternion<T>
) -> <DualQuaternion<T> as Sub<&'b DualQuaternion<T>>>::Output
impl<T> Sub<DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Sub<DualQuaternion<T>> for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn sub(
self,
rhs: DualQuaternion<T>
) -> <DualQuaternion<T> as Sub<DualQuaternion<T>>>::Output
[src]
self,
rhs: DualQuaternion<T>
) -> <DualQuaternion<T> as Sub<DualQuaternion<T>>>::Output
impl<T> Sub<Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Sub<Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn sub(
self,
rhs: Quaternion<T>
) -> <Quaternion<T> as Sub<Quaternion<T>>>::Output
[src]
self,
rhs: Quaternion<T>
) -> <Quaternion<T> as Sub<Quaternion<T>>>::Output
impl<'a, T, D2, SB, const D1: usize> Sub<Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedSub<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> Sub<Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedSub<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, const D: usize> Sub<Point<T, D>> for Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<T, const D: usize> Sub<Point<T, D>> for Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<T, R1, C1, R2, C2, SA, SB> Sub<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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> Sub<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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 sub(
self,
rhs: Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Sub<Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Sub<Matrix<T, R2, C2, SB>>>::Output
impl<'a, T, R1, C1, R2, C2, SA, SB> Sub<Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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> Sub<Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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 sub(
self,
rhs: Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Sub<Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Sub<Matrix<T, R2, C2, SB>>>::Output
impl<'b, T, D2, SB, const D1: usize> Sub<&'b Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedSub<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> Sub<&'b Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedSub<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> Sub<&'b Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, 'b, T> Sub<&'b Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn sub(
self,
rhs: &'b Quaternion<T>
) -> <&'a Quaternion<T> as Sub<&'b Quaternion<T>>>::Output
[src]
self,
rhs: &'b Quaternion<T>
) -> <&'a Quaternion<T> as Sub<&'b Quaternion<T>>>::Output
impl<T, D2, SB, const D1: usize> Sub<Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedSub<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> Sub<Matrix<T, D2, Const<1_usize>, SB>> for Point<T, D1> where
T: Scalar + ClosedSub<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, const D: usize> Sub<&'b Point<T, D>> for Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<'b, T, const D: usize> Sub<&'b Point<T, D>> for Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<'b, T, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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> Sub<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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 sub(
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Sub<&'b Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <Matrix<T, R1, C1, SA> as Sub<&'b Matrix<T, R2, C2, SB>>>::Output
impl<'a, T> Sub<DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Sub<DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn sub(
self,
rhs: DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Sub<DualQuaternion<T>>>::Output
[src]
self,
rhs: DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Sub<DualQuaternion<T>>>::Output
impl<'a, 'b, T, const D: usize> Sub<&'b Point<T, D>> for &'a Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<'a, 'b, T, const D: usize> Sub<&'b Point<T, D>> for &'a Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<'a, 'b, T> Sub<&'b DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, 'b, T> Sub<&'b DualQuaternion<T>> for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = DualQuaternion<T>
pub fn sub(
self,
rhs: &'b DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Sub<&'b DualQuaternion<T>>>::Output
[src]
self,
rhs: &'b DualQuaternion<T>
) -> <&'a DualQuaternion<T> as Sub<&'b DualQuaternion<T>>>::Output
impl<'b, T> Sub<&'b Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'b, T> Sub<&'b Quaternion<T>> for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn sub(
self,
rhs: &'b Quaternion<T>
) -> <Quaternion<T> as Sub<&'b Quaternion<T>>>::Output
[src]
self,
rhs: &'b Quaternion<T>
) -> <Quaternion<T> as Sub<&'b Quaternion<T>>>::Output
impl<'a, 'b, T, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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> Sub<&'b Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA> where
T: Scalar + ClosedSub<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 sub(
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Sub<&'b Matrix<T, R2, C2, SB>>>::Output
[src]
self,
rhs: &'b Matrix<T, R2, C2, SB>
) -> <&'a Matrix<T, R1, C1, SA> as Sub<&'b Matrix<T, R2, C2, SB>>>::Output
impl<'a, T, const D: usize> Sub<Point<T, D>> for &'a Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]
impl<'a, T, const D: usize> Sub<Point<T, D>> for &'a Point<T, D> where
T: ClosedSub<T> + Scalar,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>>,
ShapeConstraint: SameNumberOfColumns<Const<1_usize>, Const<1_usize>>,
<ShapeConstraint as SameNumberOfRows<Const<D>, Const<D>>>::Representative == Const<D>,
<ShapeConstraint as SameNumberOfColumns<Const<1_usize>, Const<1_usize>>>::Representative == Const<1_usize>,
[src]impl<'a, 'b, T, D2, SB, const D1: usize> Sub<&'b Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedSub<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> Sub<&'b Matrix<T, D2, Const<1_usize>, SB>> for &'a Point<T, D1> where
T: Scalar + ClosedSub<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> Sub<Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Sub<Quaternion<T>> for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Quaternion<T>
pub fn sub(
self,
rhs: Quaternion<T>
) -> <&'a Quaternion<T> as Sub<Quaternion<T>>>::Output
[src]
self,
rhs: Quaternion<T>
) -> <&'a Quaternion<T> as Sub<Quaternion<T>>>::Output
impl<Ul, Ur> Sub<PInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>,
Ur: Unsigned + NonZero,
impl<Ul, Ur> Sub<PInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>,
Ur: Unsigned + NonZero,
P(Ul) - P(Ur)
: We resolve this with our PrivateAdd
impl<U> Sub<PInt<U>> for Z0 where
U: Unsigned + NonZero,
impl<U> Sub<PInt<U>> for Z0 where
U: Unsigned + NonZero,
Z0 - P = N
impl Sub<B0> for UTerm
impl Sub<B0> for UTerm
UTerm - B0 = Term
impl<Ul, Ur> Sub<NInt<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> Sub<NInt<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) - N(Ur) = P(Ul + Ur)
impl<U> Sub<NInt<U>> for Z0 where
U: Unsigned + NonZero,
impl<U> Sub<NInt<U>> for Z0 where
U: Unsigned + NonZero,
Z0 - N = P
impl<U, B> Sub<B0> for UInt<U, B> where
U: Unsigned,
B: Bit,
impl<U, B> Sub<B0> for UInt<U, B> where
U: Unsigned,
B: Bit,
UInt - B0 = UInt
impl<Ul, Bl, Ur> Sub<Ur> for UInt<Ul, Bl> where
Ul: Unsigned,
Bl: Bit,
Ur: Unsigned,
UInt<Ul, Bl>: PrivateSub<Ur>,
<UInt<Ul, Bl> as PrivateSub<Ur>>::Output: Trim,
impl<Ul, Bl, Ur> Sub<Ur> for UInt<Ul, Bl> where
Ul: Unsigned,
Bl: Bit,
Ur: Unsigned,
UInt<Ul, Bl>: PrivateSub<Ur>,
<UInt<Ul, Bl> as PrivateSub<Ur>>::Output: Trim,
Subtracting unsigned integers. We just do our PrivateSub
and then Trim
the output.
impl<U> Sub<Z0> for NInt<U> where
U: Unsigned + NonZero,
impl<U> Sub<Z0> for NInt<U> where
U: Unsigned + NonZero,
NInt - Z0 = NInt
impl<U> Sub<Z0> for PInt<U> where
U: Unsigned + NonZero,
impl<U> Sub<Z0> for PInt<U> where
U: Unsigned + NonZero,
PInt - Z0 = PInt
impl<U> Sub<B1> for UInt<U, B0> where
U: Unsigned + Sub<B1>,
<U as Sub<B1>>::Output: Unsigned,
impl<U> Sub<B1> for UInt<U, B0> where
U: Unsigned + Sub<B1>,
<U as Sub<B1>>::Output: Unsigned,
UInt<U, B0> - B1 = UInt<U - B1, B1>
impl<Ul, Ur> Sub<PInt<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> Sub<PInt<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) - P(Ur) = N(Ul + Ur)
impl<U, B> Sub<B1> for UInt<UInt<U, B>, B1> where
U: Unsigned,
B: Bit,
impl<U, B> Sub<B1> for UInt<UInt<U, B>, B1> where
U: Unsigned,
B: Bit,
UInt<U, B1> - B1 = UInt<U, B0>
impl Sub<ATerm> for ATerm
impl Sub<ATerm> for ATerm
impl Sub<B1> for UInt<UTerm, B1>
impl Sub<B1> for UInt<UTerm, B1>
UInt<UTerm, B1> - B1 = UTerm
impl<Ul, Ur> Sub<NInt<Ur>> for NInt<Ul> where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero + Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>,
impl<Ul, Ur> Sub<NInt<Ur>> for NInt<Ul> where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero + Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>,
N(Ul) - N(Ur)
: We resolve this with our PrivateAdd
impl Sub<UTerm> for UTerm
impl Sub<UTerm> for UTerm
UTerm - UTerm = UTerm
Implementors
impl<'_, '_, T, S> Sub<&'_ HashSet<T, S>> for &'_ HashSet<T, S> where
T: Eq + Hash + Clone,
S: BuildHasher + Default,
[src]
impl<'_, '_, T, S> Sub<&'_ HashSet<T, S>> for &'_ HashSet<T, S> where
T: Eq + Hash + Clone,
S: BuildHasher + Default,
[src]pub fn sub(self, rhs: &HashSet<T, S>) -> HashSet<T, S>
[src]
pub fn sub(self, rhs: &HashSet<T, S>) -> HashSet<T, S>
[src]Returns the difference of self
and rhs
as a new HashSet<T, S>
.
Examples
use std::collections::HashSet; let a: HashSet<_> = vec![1, 2, 3].into_iter().collect(); let b: HashSet<_> = vec![3, 4, 5].into_iter().collect(); let set = &a - &b; let mut i = 0; let expected = [1, 2]; for x in &set { assert!(expected.contains(x)); i += 1; } assert_eq!(i, expected.len());