VectorOps

Trait VectorOps 

Source
pub trait VectorOps<O> {
    type Elem;
    type Output;

    // Required methods
    fn map<F>(self, f: F) -> Self::Output
       where F: FnMut(Self::Elem) -> O;
    fn zip<F>(self, rhs: Self, f: F) -> Self::Output
       where F: FnMut(Self::Elem, Self::Elem) -> O;
}
Expand description

Additional element-wise operations on euclid types.

Required Associated Types§

Source

type Elem

Input vector element type.

Source

type Output

Output vector type.

Required Methods§

Source

fn map<F>(self, f: F) -> Self::Output
where F: FnMut(Self::Elem) -> O,

Apply the function to each element.

Source

fn zip<F>(self, rhs: Self, f: F) -> Self::Output
where F: FnMut(Self::Elem, Self::Elem) -> O,

Apply the function to each element of the two inputs, pairwise.

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<T, O, U> VectorOps<O> for Box3D<T, U>
where O: Copy,

Source§

type Elem = T

Source§

type Output = Box3D<O, U>

Source§

fn map<F>(self, f: F) -> <Box3D<T, U> as VectorOps<O>>::Output
where F: FnMut(<Box3D<T, U> as VectorOps<O>>::Elem) -> O,

Source§

fn zip<F>(self, rhs: Box3D<T, U>, f: F) -> <Box3D<T, U> as VectorOps<O>>::Output
where F: FnMut(<Box3D<T, U> as VectorOps<O>>::Elem, <Box3D<T, U> as VectorOps<O>>::Elem) -> O,

Source§

impl<T, O, U> VectorOps<O> for Size2D<T, U>

Source§

type Elem = T

Source§

type Output = Size2D<O, U>

Source§

fn map<F>(self, f: F) -> <Size2D<T, U> as VectorOps<O>>::Output
where F: FnMut(<Size2D<T, U> as VectorOps<O>>::Elem) -> O,

Source§

fn zip<F>( self, rhs: Size2D<T, U>, f: F, ) -> <Size2D<T, U> as VectorOps<O>>::Output
where F: FnMut(<Size2D<T, U> as VectorOps<O>>::Elem, <Size2D<T, U> as VectorOps<O>>::Elem) -> O,

Source§

impl<T, O, U> VectorOps<O> for Size3D<T, U>

Source§

type Elem = T

Source§

type Output = Size3D<O, U>

Source§

fn map<F>(self, f: F) -> <Size3D<T, U> as VectorOps<O>>::Output
where F: FnMut(<Size3D<T, U> as VectorOps<O>>::Elem) -> O,

Source§

fn zip<F>( self, rhs: Size3D<T, U>, f: F, ) -> <Size3D<T, U> as VectorOps<O>>::Output
where F: FnMut(<Size3D<T, U> as VectorOps<O>>::Elem, <Size3D<T, U> as VectorOps<O>>::Elem) -> O,

Implementors§