Skip to main content

MappedProjection

Struct MappedProjection 

Source
pub struct MappedProjection<P, F, U>
where P: Projection, F: Fn(P::Output) -> U + Send + Sync,
{ /* private fields */ }
Expand description

A mapping projection that applies a function to another projection’s output

Implementations§

Source§

impl<P, F, U> MappedProjection<P, F, U>
where P: Projection, F: Fn(P::Output) -> U + Send + Sync,

Source

pub fn new(inner: P, map_fn: F, name: impl Into<String>) -> Self

Create a new mapped projection

Trait Implementations§

Source§

impl<P, F, U> Projection for MappedProjection<P, F, U>
where P: Projection, F: Fn(P::Output) -> U + Send + Sync, U: Send + Sync,

Source§

type Output = U

The output type of this projection
Source§

fn project(&self, mv: &GA3) -> U

Project a multivector to the output type
Source§

fn name(&self) -> &str

Name of this projection (for debugging)

Auto Trait Implementations§

§

impl<P, F, U> Freeze for MappedProjection<P, F, U>
where P: Freeze, F: Freeze,

§

impl<P, F, U> RefUnwindSafe for MappedProjection<P, F, U>

§

impl<P, F, U> Send for MappedProjection<P, F, U>

§

impl<P, F, U> Sync for MappedProjection<P, F, U>

§

impl<P, F, U> Unpin for MappedProjection<P, F, U>
where P: Unpin, F: Unpin,

§

impl<P, F, U> UnsafeUnpin for MappedProjection<P, F, U>
where P: UnsafeUnpin, F: UnsafeUnpin,

§

impl<P, F, U> UnwindSafe for MappedProjection<P, F, U>
where P: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.