pub struct CollectionFormer<E, Definition>{ /* private fields */ }Expand description
A builder structure for constructing collections with a fluent and flexible interface.
Implementations§
Source§impl<E, Definition> CollectionFormer<E, Definition>
impl<E, Definition> CollectionFormer<E, Definition>
Sourcepub fn begin(
storage: Option<Definition::Storage>,
context: Option<Definition::Context>,
on_end: Definition::End,
) -> Self
pub fn begin( storage: Option<Definition::Storage>, context: Option<Definition::Context>, on_end: Definition::End, ) -> Self
Begins the construction process of a collection with optional initial storage and context,
setting up an on_end completion handler to finalize the collection’s construction.
§Panics
qqq: doc
Sourcepub fn begin_coercing<IntoEnd>(
storage: Option<Definition::Storage>,
context: Option<Definition::Context>,
on_end: IntoEnd,
) -> Self
pub fn begin_coercing<IntoEnd>( storage: Option<Definition::Storage>, context: Option<Definition::Context>, on_end: IntoEnd, ) -> Self
Provides a variation of the begin method allowing for coercion of the end handler,
facilitating ease of integration with different end conditions.
§Panics
qqq: docs
Sourcepub fn end(self) -> Definition::Formed
pub fn end(self) -> Definition::Formed
Finalizes the building process, returning the formed or a context incorporating it.
§Panics
qqq: doc
Source§impl<E, Storage, Formed, Definition> CollectionFormer<E, Definition>where
Definition: FormerDefinition<Context = (), Storage = Storage, Formed = Formed>,
Definition::Storage: CollectionAdd<Entry = E>,
impl<E, Storage, Formed, Definition> CollectionFormer<E, Definition>where
Definition: FormerDefinition<Context = (), Storage = Storage, Formed = Formed>,
Definition::Storage: CollectionAdd<Entry = E>,
Sourcepub fn new(end: Definition::End) -> Self
pub fn new(end: Definition::End) -> Self
Constructs a new CollectionFormer instance, starting with an empty storage.
This method serves as the entry point for the builder pattern, facilitating the
creation of a new collection.
Sourcepub fn new_coercing<IntoEnd>(end: IntoEnd) -> Self
pub fn new_coercing<IntoEnd>(end: IntoEnd) -> Self
Variant of the new method allowing for end condition coercion, providing flexibility
in specifying different types of end conditions dynamically.
Source§impl<E, Definition> CollectionFormer<E, Definition>
impl<E, Definition> CollectionFormer<E, Definition>
Trait Implementations§
Source§impl<E, Definition> Debug for CollectionFormer<E, Definition>
impl<E, Definition> Debug for CollectionFormer<E, Definition>
Source§impl<E: Default, Definition> Default for CollectionFormer<E, Definition>where
Definition: FormerDefinition + Default,
Definition::Storage: CollectionAdd<Entry = E> + Default,
Definition::Context: Default,
Definition::End: Default,
impl<E: Default, Definition> Default for CollectionFormer<E, Definition>where
Definition: FormerDefinition + Default,
Definition::Storage: CollectionAdd<Entry = E> + Default,
Definition::Context: Default,
Definition::End: Default,
Source§fn default() -> CollectionFormer<E, Definition>
fn default() -> CollectionFormer<E, Definition>
Source§impl<'a, E, Definition> FormerBegin<'a, Definition> for CollectionFormer<E, Definition>where
Definition: FormerDefinition,
Definition::Storage: CollectionAdd<Entry = E> + 'a,
Definition::Context: 'a,
Definition::End: 'a,
impl<'a, E, Definition> FormerBegin<'a, Definition> for CollectionFormer<E, Definition>where
Definition: FormerDefinition,
Definition::Storage: CollectionAdd<Entry = E> + 'a,
Definition::Context: 'a,
Definition::End: 'a,
Auto Trait Implementations§
impl<E, Definition> Freeze for CollectionFormer<E, Definition>where
<Definition as FormerDefinition>::Storage: Freeze,
<Definition as FormerDefinition>::Context: Freeze,
<Definition as FormerDefinition>::End: Freeze,
impl<E, Definition> RefUnwindSafe for CollectionFormer<E, Definition>where
<Definition as FormerDefinition>::Storage: RefUnwindSafe,
<Definition as FormerDefinition>::Context: RefUnwindSafe,
<Definition as FormerDefinition>::End: RefUnwindSafe,
impl<E, Definition> Send for CollectionFormer<E, Definition>where
<Definition as FormerDefinition>::Storage: Send,
<Definition as FormerDefinition>::Context: Send,
<Definition as FormerDefinition>::End: Send,
impl<E, Definition> Sync for CollectionFormer<E, Definition>where
<Definition as FormerDefinition>::Storage: Sync,
<Definition as FormerDefinition>::Context: Sync,
<Definition as FormerDefinition>::End: Sync,
impl<E, Definition> Unpin for CollectionFormer<E, Definition>where
<Definition as FormerDefinition>::Storage: Unpin,
<Definition as FormerDefinition>::Context: Unpin,
<Definition as FormerDefinition>::End: Unpin,
impl<E, Definition> UnwindSafe for CollectionFormer<E, Definition>where
<Definition as FormerDefinition>::Storage: UnwindSafe,
<Definition as FormerDefinition>::Context: UnwindSafe,
<Definition as FormerDefinition>::End: UnwindSafe,
Blanket Implementations§
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
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Entry is defined by the Collection trait.