Trait former::exposed::StoragePreform

source ·
pub trait StoragePreform: Storage {
    // Required method
    fn preform(self) -> Self::Preformed;
}
Expand description

Provides a mechanism to finalize the forming process by converting storage into its final formed state.

This trait is crucial for transitioning the mutable, intermediate storage state into the final, immutable state of an entity. The transformation is typically performed once all configurations and modifications are applied to the storage during the forming process. The type Preformed and Formed is generally the structure for which the Former is derived, representing the fully formed state of the entity. However, it can differ if a custom FormingEnd or a different Formed type is defined to handle specific forming logic or requirements. But even if Formed is custom Preformed is always that structure.

Required Methods§

source

fn preform(self) -> Self::Preformed

Transforms the storage into the final formed state of the entity.

This function is called at the conclusion of the forming process to finalize the entity’s state, effectively turning the mutable storage state into the immutable, fully formed entity. This transition reflects the culmination of the forming process where the temporary, modifiable attributes of the storage are solidified into the permanent attributes of the formed entity.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<E> StoragePreform for BinaryHeap<E>
where E: Ord,

source§

impl<E> StoragePreform for BTreeSet<E>

source§

impl<E> StoragePreform for LinkedList<E>

source§

impl<E> StoragePreform for VecDeque<E>

source§

impl<E> StoragePreform for Vec<E>

source§

fn preform(self) -> <Vec<E> as Storage>::Preformed

source§

impl<K> StoragePreform for HashSet<K>
where K: Eq + Hash,

source§

impl<K, E> StoragePreform for BTreeMap<K, E>
where K: Ord,

source§

fn preform(self) -> <BTreeMap<K, E> as Storage>::Preformed

source§

impl<K, E> StoragePreform for HashMap<K, E>
where K: Eq + Hash,

source§

fn preform(self) -> <HashMap<K, E> as Storage>::Preformed

Implementors§