pub trait GhtGet: GeneralizedHashTrieNode {
type Get: GeneralizedHashTrieNode<Schema = Self::Schema>;
// Required methods
fn get<'a>(&'a self, head: &Self::Head) -> Option<&'a Self::Get>;
fn get_mut<'a>(&'a mut self, head: &Self::Head) -> Option<&'a mut Self::Get>;
fn iter(&self) -> impl Iterator<Item = Self::Head>;
fn iter_tuples(
&self,
) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>;
}
Expand description
A trait for the get and iter methods from Wang/Willsey/Suciu, which work differently on leaves than internal nodes
Required Associated Types§
sourcetype Get: GeneralizedHashTrieNode<Schema = Self::Schema>
type Get: GeneralizedHashTrieNode<Schema = Self::Schema>
Type returned by Self::get
.
Required Methods§
sourcefn get<'a>(&'a self, head: &Self::Head) -> Option<&'a Self::Get>
fn get<'a>(&'a self, head: &Self::Head) -> Option<&'a Self::Get>
On an Inner node, retrieves the value (child) associated with the given “head” key.
returns an Option
containing a reference to the value if found, or None
if not found.
On a Leaf node, returns None.
sourcefn get_mut<'a>(&'a mut self, head: &Self::Head) -> Option<&'a mut Self::Get>
fn get_mut<'a>(&'a mut self, head: &Self::Head) -> Option<&'a mut Self::Get>
get, but mutable output
sourcefn iter(&self) -> impl Iterator<Item = Self::Head>
fn iter(&self) -> impl Iterator<Item = Self::Head>
Iterator for the “head” keys (from inner nodes) or nothing (from leaf nodes).
sourcefn iter_tuples(
&self,
) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>
fn iter_tuples( &self, ) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>
Iterator for the tuples (from leaf nodes) or nothing (from inner nodes).
Object Safety§
This trait is not object safe.