pub trait Query<I, V>where
I: Identity,
V: Identifiable<I>,{
// Required methods
fn query(&self, identifier: &I) -> Option<&V>;
fn all(&self) -> Vec<&V>;
// Provided method
fn create_index(&self) -> HashMap<I, Link<'_, I, V>> { ... }
}
Expand description
Be able to query some type given an identifier. It must return a type that can be queried for more values like itself.
Query a datastore for a type that can be used to find more like it