Trait certain_map::ParamSet
source · pub trait ParamSet<T> {
type Transformed;
// Required method
fn param_set(self, item: T) -> Self::Transformed;
}Expand description
Item of type T is vacant in certain_map slot.
The ParamSet<T> trait transforms the struct when a value is set. If the slot corresponding to the value
of type T is currently of type Vacant, setting a value using param_set will transform it to Occupied,
indicating that the value has been set. This transformation is reflected in the returned Transformed type.
By using the ParamSet<T> as a trait bound, you can ensure that you are not overwriting a field that has already been
set. If you attempt to set a value in a slot that is already Occupied, the Rust compiler will raise an error,
preventing accidental overwrites and ensuring the integrity of the certain_map slots.