Skip to main content

FormingEnd

Trait FormingEnd 

Source
pub trait FormingEnd<Definition>
where Definition: FormerDefinitionTypes,
{ // Required method fn call( &self, storage: <Definition as FormerDefinitionTypes>::Storage, context: Option<<Definition as FormerDefinitionTypes>::Context>, ) -> <Definition as FormerDefinitionTypes>::Formed; }
Expand description

Defines a handler for the end of a subforming process, enabling the return of the original context.

This trait is designed to be flexible, allowing for various end-of-forming behaviors in builder patterns. Implementors can define how to transform or pass through the context during the forming process’s completion.

§Parameters

  • Storage : The type of the collection being processed.
  • Context : The type of the context that might be altered or returned upon completion.

Required Methods§

Source

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

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

§Parameters
  • collection : The collection being processed.
  • context : Optional context to be transformed or returned.
§Returns

Returns the transformed or original context based on the implementation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Definition, F> FormingEnd<Definition> for F
where F: Fn(<Definition as FormerDefinitionTypes>::Storage, Option<<Definition as FormerDefinitionTypes>::Context>) -> <Definition as FormerDefinitionTypes>::Formed, Definition: FormerDefinitionTypes,

Source§

impl<Definition, T> FormingEnd<Definition> for ReturnStorage
where Definition: FormerDefinitionTypes<Context = (), Storage = T, Formed = T>,

Source§

impl<Definition> FormingEnd<Definition> for FormingEndClosure<Definition>
where Definition: FormerDefinitionTypes,

Available on crate feature use_alloc or non-crate feature no_std only.
Source§

impl<Definition> FormingEnd<Definition> for NoEnd
where Definition: FormerDefinitionTypes,

Source§

impl<Definition> FormingEnd<Definition> for ReturnPreformed
where <Definition as FormerDefinitionTypes>::Storage: StoragePreform<Preformed = <Definition as FormerDefinitionTypes>::Formed>, Definition: FormerDefinitionTypes,