Struct former::exposed::FormingEndWrapper
source · 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>
impl<Storage, Context> FormingEndWrapper<Storage, Context>
sourcepub fn new(
closure: impl Fn(Storage, Option<Context>) -> Context + 'static
) -> Self
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 thecall
method of theFormingEnd
trait implementation.
§Returns
Returns an instance of FormingEndWrapper
encapsulating the provided closure.
Trait Implementations§
source§impl<Storage, Context> Debug for FormingEndWrapper<Storage, Context>
impl<Storage, Context> Debug for FormingEndWrapper<Storage, Context>
source§impl<Storage, Context> FormingEnd<Storage, Context> for FormingEndWrapper<Storage, Context>
impl<Storage, Context> FormingEnd<Storage, Context> for FormingEndWrapper<Storage, Context>
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<S> AssignWithType for S
impl<S> AssignWithType for S
source§fn assign_with_type<T, IntoT>(&mut self, component: IntoT)where
IntoT: Into<T>,
S: ComponentAssign<T, IntoT>,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more