Trait enso_flexer::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
Loading content...Required methods
Loading content...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<'a, N, D> Sub<Point<N, D>> for &'a Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]
impl<'a, N, D> Sub<Point<N, D>> for &'a Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, U1, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, <ShapeConstraint as SameNumberOfColumns<U1, U1>>::Representative>>::Buffer>
pub fn sub(
self,
right: Point<N, D>
) -> <&'a Point<N, D> as Sub<Point<N, D>>>::Output
[src]
self,
right: Point<N, D>
) -> <&'a Point<N, D> as Sub<Point<N, D>>>::Output
impl<'a, 'b, N, D> Sub<&'b Point<N, D>> for &'a Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]
impl<'a, 'b, N, D> Sub<&'b Point<N, D>> for &'a Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, U1, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, <ShapeConstraint as SameNumberOfColumns<U1, U1>>::Representative>>::Buffer>
pub fn sub(
self,
right: &'b Point<N, D>
) -> <&'a Point<N, D> as Sub<&'b Point<N, D>>>::Output
[src]
self,
right: &'b Point<N, D>
) -> <&'a Point<N, D> as Sub<&'b Point<N, D>>>::Output
impl<'b, N> Sub<&'b Quaternion<N>> for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
impl<'b, N> Sub<&'b Quaternion<N>> for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]type Output = Quaternion<N>
pub fn sub(
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
impl<'a, 'b, N, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<N, R2, C2, SB>> for &'a Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]
impl<'a, 'b, N, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<N, R2, C2, SB>> for &'a Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>
pub fn sub(
self,
rhs: &'b Matrix<N, R2, C2, SB>
) -> <&'a Matrix<N, R1, C1, SA> as Sub<&'b Matrix<N, R2, C2, SB>>>::Output
[src]
self,
rhs: &'b Matrix<N, R2, C2, SB>
) -> <&'a Matrix<N, R1, C1, SA> as Sub<&'b Matrix<N, R2, C2, SB>>>::Output
impl<'b, N, D1, D2, SB> Sub<&'b Matrix<N, D2, U1, SB>> for Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]
impl<'b, N, D1, D2, SB> Sub<&'b Matrix<N, D2, U1, SB>> for Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]impl<N> Sub<Quaternion<N>> for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
impl<N> Sub<Quaternion<N>> for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]type Output = Quaternion<N>
pub fn sub(
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Sub<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Sub<Quaternion<N>>>::Output
impl<N, R1, C1, R2, C2, SA, SB> Sub<Matrix<N, R2, C2, SB>> for Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]
impl<N, R1, C1, R2, C2, SA, SB> Sub<Matrix<N, R2, C2, SB>> for Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>
pub fn sub(
self,
rhs: Matrix<N, R2, C2, SB>
) -> <Matrix<N, R1, C1, SA> as Sub<Matrix<N, R2, C2, SB>>>::Output
[src]
self,
rhs: Matrix<N, R2, C2, SB>
) -> <Matrix<N, R1, C1, SA> as Sub<Matrix<N, R2, C2, SB>>>::Output
impl<'b, N, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<N, R2, C2, SB>> for Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]
impl<'b, N, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<N, R2, C2, SB>> for Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
ShapeConstraint: SameNumberOfColumns<C1, C2>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>
pub fn sub(
self,
rhs: &'b Matrix<N, R2, C2, SB>
) -> <Matrix<N, R1, C1, SA> as Sub<&'b Matrix<N, R2, C2, SB>>>::Output
[src]
self,
rhs: &'b Matrix<N, R2, C2, SB>
) -> <Matrix<N, R1, C1, SA> as Sub<&'b Matrix<N, R2, C2, SB>>>::Output
impl<'a, N, R1, C1, R2, C2, SA, SB> Sub<Matrix<N, R2, C2, SB>> for &'a Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R2, C2, R1, C1>,
ShapeConstraint: SameNumberOfRows<R2, R1>,
ShapeConstraint: SameNumberOfColumns<C2, C1>,
[src]
impl<'a, N, R1, C1, R2, C2, SA, SB> Sub<Matrix<N, R2, C2, SB>> for &'a Matrix<N, R1, C1, SA> where
N: Scalar + ClosedSub<N>,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
R1: Dim,
C1: Dim,
SA: Storage<N, R1, C1>,
DefaultAllocator: SameShapeAllocator<N, R2, C2, R1, C1>,
ShapeConstraint: SameNumberOfRows<R2, R1>,
ShapeConstraint: SameNumberOfColumns<C2, C1>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative>>::Buffer>
pub fn sub(
self,
rhs: Matrix<N, R2, C2, SB>
) -> <&'a Matrix<N, R1, C1, SA> as Sub<Matrix<N, R2, C2, SB>>>::Output
[src]
self,
rhs: Matrix<N, R2, C2, SB>
) -> <&'a Matrix<N, R1, C1, SA> as Sub<Matrix<N, R2, C2, SB>>>::Output
impl<N, D1, D2, SB> Sub<Matrix<N, D2, U1, SB>> for Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]
impl<N, D1, D2, SB> Sub<Matrix<N, D2, U1, SB>> for Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]impl<'a, N> Sub<Quaternion<N>> for &'a Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
impl<'a, N> Sub<Quaternion<N>> for &'a Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]type Output = Quaternion<N>
pub fn sub(
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Sub<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Sub<Quaternion<N>>>::Output
impl<'a, 'b, N, D1, D2, SB> Sub<&'b Matrix<N, D2, U1, SB>> for &'a Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]
impl<'a, 'b, N, D1, D2, SB> Sub<&'b Matrix<N, D2, U1, SB>> for &'a Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]impl<'a, N, D1, D2, SB> Sub<Matrix<N, D2, U1, SB>> for &'a Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]
impl<'a, N, D1, D2, SB> Sub<Matrix<N, D2, U1, SB>> for &'a Point<N, D1> where
N: Scalar + ClosedSub<N>,
D1: DimName,
D2: Dim,
SB: Storage<N, D2, U1>,
DefaultAllocator: Allocator<N, D1, U1>,
DefaultAllocator: Allocator<N, D2, U1>,
DefaultAllocator: SameShapeAllocator<N, D1, U1, D2, U1>,
ShapeConstraint: SameNumberOfRows<D1, D2>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
<ShapeConstraint as SameNumberOfRows<D1, D2>>::Representative == D1,
[src]impl<'a, 'b, N> Sub<&'b Quaternion<N>> for &'a Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
impl<'a, 'b, N> Sub<&'b Quaternion<N>> for &'a Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]type Output = Quaternion<N>
pub fn sub(
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
impl<'b, N, D> Sub<&'b Point<N, D>> for Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]
impl<'b, N, D> Sub<&'b Point<N, D>> for Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, U1, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, <ShapeConstraint as SameNumberOfColumns<U1, U1>>::Representative>>::Buffer>
pub fn sub(
self,
right: &'b Point<N, D>
) -> <Point<N, D> as Sub<&'b Point<N, D>>>::Output
[src]
self,
right: &'b Point<N, D>
) -> <Point<N, D> as Sub<&'b Point<N, D>>>::Output
impl<N, D> Sub<Point<N, D>> for Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]
impl<N, D> Sub<Point<N, D>> for Point<N, D> where
N: Scalar + ClosedSub<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D, U1>,
DefaultAllocator: SameShapeAllocator<N, D, U1, D, U1>,
ShapeConstraint: SameNumberOfRows<D, D>,
ShapeConstraint: SameNumberOfColumns<U1, U1>,
[src]type Output = Matrix<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, U1, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<D, D>>::Representative, <ShapeConstraint as SameNumberOfColumns<U1, U1>>::Representative>>::Buffer>
pub fn sub(
self,
right: Point<N, D>
) -> <Point<N, D> as Sub<Point<N, D>>>::Output
[src]
self,
right: Point<N, D>
) -> <Point<N, D> as Sub<Point<N, D>>>::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
B: Bit,
U: Unsigned,
impl<U, B> Sub<B0> for UInt<U, B> where
B: Bit,
U: Unsigned,
UInt - B0 = UInt
impl<Ul, Bl, Ur> Sub<Ur> for UInt<Ul, Bl> where
Ul: Unsigned,
Ur: Unsigned,
Bl: Bit,
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,
Ur: Unsigned,
Bl: Bit,
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
B: Bit,
U: Unsigned,
impl<U, B> Sub<B1> for UInt<UInt<U, B>, B1> where
B: Bit,
U: Unsigned,
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());