Skip to main content

CustomProjection

Struct CustomProjection 

Source
pub struct CustomProjection<F, T>
where F: Fn(&GA3) -> T + Send + Sync,
{ /* private fields */ }
Expand description

A custom projection defined by a closure

Implementations§

Source§

impl<F, T> CustomProjection<F, T>
where F: Fn(&GA3) -> T + Send + Sync,

Source

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

Create a new custom projection

Trait Implementations§

Source§

impl<F, T> Projection for CustomProjection<F, T>
where F: Fn(&GA3) -> T + Send + Sync, T: Send + Sync,

Source§

type Output = T

The output type of this projection
Source§

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

Project a multivector to the output type
Source§

fn name(&self) -> &str

Name of this projection (for debugging)

Auto Trait Implementations§

§

impl<F, T> Freeze for CustomProjection<F, T>
where F: Freeze,

§

impl<F, T> RefUnwindSafe for CustomProjection<F, T>
where F: RefUnwindSafe,

§

impl<F, T> Send for CustomProjection<F, T>

§

impl<F, T> Sync for CustomProjection<F, T>

§

impl<F, T> Unpin for CustomProjection<F, T>
where F: Unpin,

§

impl<F, T> UnsafeUnpin for CustomProjection<F, T>
where F: UnsafeUnpin,

§

impl<F, T> UnwindSafe for CustomProjection<F, T>
where 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.