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).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.