Trait former::exposed::Collection
source · pub trait Collection {
type Entry;
type Val;
// Required method
fn entry_to_val(e: Self::Entry) -> Self::Val;
}
Expand description
Represents a collection by defining the types of entries and values it handles.
This trait abstracts the nature of collections in data structures, facilitating the handling of contained
entries and values, especially in scenarios where the structure of the collection allows for complex relationships,
such as HashMap
s. It not only identifies what constitutes an entry and a value in the context of the collection
but also provides utility for converting between these two, which is critical in operations involving entry manipulation
and value retrieval.
Required Associated Types§
Required Methods§
sourcefn entry_to_val(e: Self::Entry) -> Self::Val
fn entry_to_val(e: Self::Entry) -> Self::Val
Converts an entry to its corresponding value within the collection. This function is essential for abstracting the collection’s internal representation from the values it manipulates.
Object Safety§
This trait is not object safe.