MapComponents

Trait MapComponents 

Source
pub trait MapComponents {
    type Scalar;

    // Required methods
    fn map_components_unary(
        self,
        f: impl Fn(Self::Scalar) -> Self::Scalar,
    ) -> Self;
    fn map_components_binary(
        self,
        other: Self,
        f: impl Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
    ) -> Self;
}

Required Associated Types§

Required Methods§

Source

fn map_components_unary(self, f: impl Fn(Self::Scalar) -> Self::Scalar) -> Self

Returns the point after applying f component-wise.

Source

fn map_components_binary( self, other: Self, f: impl Fn(Self::Scalar, Self::Scalar) -> Self::Scalar, ) -> Self

Returns the point after applying f component-wise to both self and other in parallel.

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.

Implementors§

Source§

impl<T> MapComponents for PointN<[T; 2]>
where T: Copy,

Source§

impl<T> MapComponents for PointN<[T; 3]>
where T: Copy,