Skip to main content

ApplyFn

Struct ApplyFn 

Source
pub struct ApplyFn<'a, A, B> { /* private fields */ }
Expand description

An ApplyFn is a function from A to B wrapped in something Rust’s type system can more easily digest. Arguments for Apply::apply() are required to be of this type rather than an arbitrary type matching Fn(A) -> B.

Implementations§

Source§

impl<'a, A, B> ApplyFn<'a, A, B>

Source

pub fn apply(&self, a: A) -> B

Apply the wrapped function to a value of type A.

Trait Implementations§

Source§

impl<'a, A, B> Debug for ApplyFn<'a, A, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, A, B, F> From<F> for ApplyFn<'a, A, B>
where F: 'a + Fn(A) -> B,

Source§

fn from(f: F) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, A, B> Freeze for ApplyFn<'a, A, B>

§

impl<'a, A, B> !RefUnwindSafe for ApplyFn<'a, A, B>

§

impl<'a, A, B> !Send for ApplyFn<'a, A, B>

§

impl<'a, A, B> !Sync for ApplyFn<'a, A, B>

§

impl<'a, A, B> Unpin for ApplyFn<'a, A, B>

§

impl<'a, A, B> UnsafeUnpin for ApplyFn<'a, A, B>

§

impl<'a, A, B> !UnwindSafe for ApplyFn<'a, A, B>

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.