Trait VSub

Source
pub trait VSub<Rhs: Vector>: Vector
where Self::Output: Vector,
{ type Output; // Required method fn sub(self, rhs: Rhs) -> Self::Output; }

Required Associated Types§

Required Methods§

Source

fn sub(self, rhs: Rhs) -> Self::Output

Subtracts two vector-arrays of equal dimensions

u - v

§Arguments
  • rhs - The vector to subtract
§Examples
let u = [1.0, 2.0];
let v = [3.0, 4.0];
let w = [u[0] - v[0], u[1] - v[1]];
assert_eq!(u.add(v), w);

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.

Implementations on Foreign Types§

Source§

impl<T1, T2, const L: usize> VSub<[T2; L]> for [T1; L]
where Self: Vector, [T2; L]: Vector, [<T1 as Add<T2>>::Output; L]: Vector, T1: Add<T2> + Clone, T2: Clone,

Source§

type Output = [<T1 as Add<T2>>::Output; L]

Source§

fn sub(self, rhs: [T2; L]) -> Self::Output

Implementors§