Module identified_vec_of

Module identified_vec_of 

Source
Expand description

The Identifiable trait allows you to use the IdentifiedVecOf<User> instead of the more verbose IdentifiedVec<SomeUserID, User>but also allows you to skip theid_of_element: fn(&Element) -> ID` closure when initializing a new identified vec.

Macros§

newtype_identified_vec

Enums§

Error

Traits§

Identifiable
The Identifiable trait allows you to use the IdentifiedVecOf<User> instead of the more verbose IdentifiedVec<SomeUserID, User>but also allows you to skip theid_of_element: fn(&Element) -> ID` closure when initializing a new identified vec.
IsIdentifiableVecOfVia
IsIdentifiedVecOf
ViaMarker
https://stackoverflow.com/a/66537661/1311272

Type Aliases§

IdentifiedVecOf
IdentifiedVecOf /// A type alias for IdentifiedVec<Element::ID, Element>, this is the preferred and most powerful collection type of this crate, requires that your Elements impl the Identifiable trait. Using this collection allows you to skip passing the id_of_element: fn(&Element) -> ID closure which you otherwise need to pass when initializing an IdentifiedVec. Using IdentifiedVecOf together with feature “serde” also gives serde serialization/deserialization as if it were a Vec<Element>, given that Element implements serde serialization/deserialization of course.