Skip to main content

Along

Trait Along 

Source
pub trait Along {
    type Unit;

    // Required methods
    fn along(&self, axis: Axis) -> Self::Unit;
    fn apply_along(
        &self,
        axis: Axis,
        f: impl FnOnce(Self::Unit) -> Self::Unit,
    ) -> Self;
}
Expand description

A trait for accessing the given unit along a certain axis.

Required Associated Types§

Source

type Unit

The unit associated with this type

Required Methods§

Source

fn along(&self, axis: Axis) -> Self::Unit

Returns the unit along the given axis.

Source

fn apply_along( &self, axis: Axis, f: impl FnOnce(Self::Unit) -> Self::Unit, ) -> Self

Applies the given function to the unit along the given axis and returns a new value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Clone + Debug + Default + PartialEq> Along for Point<T>

Source§

type Unit = T

Source§

impl<T> Along for Size<T>
where T: Clone + Debug + Default + PartialEq,

Source§

type Unit = T