Trait lattices::ght::GhtGet

source ·
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§

source

type Get: GeneralizedHashTrieNode<Schema = Self::Schema>

Type returned by Self::get.

Required Methods§

source

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.

source

fn get_mut<'a>(&'a mut self, head: &Self::Head) -> Option<&'a mut Self::Get>

get, but mutable output

source

fn iter(&self) -> impl Iterator<Item = Self::Head>

Iterator for the “head” keys (from inner nodes) or nothing (from leaf nodes).

source

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.

Implementors§

source§

impl<Head, Node> GhtGet for GhtInner<Head, Node>
where Head: 'static + Eq + Hash + Clone, Node: 'static + GeneralizedHashTrieNode, Node::Schema: SplitBySuffix<(Head, Node::SuffixSchema)>,

source§

type Get = Node

source§

impl<Schema, ValType, Storage> GhtGet for GhtLeaf<Schema, ValType, Storage>
where Schema: 'static + Eq + Hash + Clone + PartialEqVariadic + SplitBySuffix<ValType>, ValType: Eq + Hash + Clone + PartialEqVariadic, <Schema as SplitBySuffix<ValType>>::Prefix: Eq + Hash + Clone, GhtLeaf<Schema, ValType, Storage>: GeneralizedHashTrieNode<Schema = Schema>, Storage: VariadicCollection<Schema = Schema>,

source§

type Get = GhtLeaf<Schema, ValType, Storage>