Trait former::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§
sourcefn preform(self) -> Self::Preformed
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.