pub struct FormingEndWrapper<Storage, Context> { /* private fields */ }
Expand description

A wrapper around a closure to be used as a FormingEnd.

This struct allows for dynamic dispatch of a closure that matches the FormingEnd trait’s call method signature. It is useful for cases where a closure needs to be stored or passed around as an object implementing FormingEnd.

§Type Parameters

  • Storage - The type of the container being processed. This type is passed to the closure when it’s called.
  • Context - The type of the context that may be altered or returned by the closure. This allows for flexible manipulation of context based on the container.

Implementations§

source§

impl<Storage, Context> FormingEndWrapper<Storage, Context>

source

pub fn new( closure: impl Fn(Storage, Option<Context>) -> Context + 'static ) -> Self

Constructs a new FormingEndWrapper with the provided closure.

§Parameters
  • closure - A closure that matches the expected signature for transforming a container and context into a new context. This closure is stored and called by the call method of the FormingEnd trait implementation.
§Returns

Returns an instance of FormingEndWrapper encapsulating the provided closure.

Trait Implementations§

source§

impl<Storage, Context> Debug for FormingEndWrapper<Storage, Context>

source§

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

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

impl<Storage, Context> FormingEnd<Storage, Context> for FormingEndWrapper<Storage, Context>

source§

fn call(&self, storage: Storage, context: Option<Context>) -> Context

Called at the end of the subforming process to return the modified or original context. Read more

Auto Trait Implementations§

§

impl<Storage, Context> Freeze for FormingEndWrapper<Storage, Context>

§

impl<Storage, Context> !RefUnwindSafe for FormingEndWrapper<Storage, Context>

§

impl<Storage, Context> !Send for FormingEndWrapper<Storage, Context>

§

impl<Storage, Context> !Sync for FormingEndWrapper<Storage, Context>

§

impl<Storage, Context> Unpin for FormingEndWrapper<Storage, Context>
where Storage: Unpin,

§

impl<Storage, Context> !UnwindSafe for FormingEndWrapper<Storage, Context>

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<S> AssignWithType for S

source§

fn assign_with_type<T, IntoT>(&mut self, component: IntoT)
where IntoT: Into<T>, S: ComponentAssign<T, IntoT>,

Function to set value of a component by its type.
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>,

§

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>,

§

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.