Trait lattices::ght::colt::ColtForestNode

source ·
pub trait ColtForestNode: GeneralizedHashTrieNode {
    type Force: GeneralizedHashTrieNode;

    // Required methods
    fn force(self) -> Option<Self::Force>;
    fn force_drain(&mut self) -> Option<Self::Force>;
}
Expand description

Data structure design for our COLT is unique.

In the paper, the COLT is an unbalanced trie that “grows upward” from leaves lazily on access via the force method. Unfortunately, unbalanced tries break our types: a node’s type to be defined via the type of its children, recursively – meaning all paths need to be the same type (and length)!

To work around this, our COLT is a variadic list GHTs (a forest) of increasing height, starting with a trie of height 0 and continuing until a trie of height |key| - 1. Our force method does not add a node above a leaf L as in the paper. Instead it takes L from the current trie and merges it into the next trie to the right which is 1 taller. The following trait provides the behavior we need from the nodes in a COLT forest. Every ColtForestNode is a GeneralizedHashTrieNode with some extra methods.

Required Associated Types§

source

type Force: GeneralizedHashTrieNode

result of forceing a node

Required Methods§

source

fn force(self) -> Option<Self::Force>

Force the generation of a parent node, as in the Wang/Willsey/Suciu COLT structure, to be merged into the next trie to the right.

source

fn force_drain(&mut self) -> Option<Self::Force>

Force the generation of a parent node but retain ref to this node

Object Safety§

This trait is not object safe.

Implementors§

source§

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

source§

type Force = Node

source§

impl<Schema, Head, Rest, Storage> ColtForestNode for GhtLeaf<Schema, (Head, Rest), Storage>
where Head: 'static + Clone + Hash + Eq, Rest: 'static + Clone + Hash + Eq + VariadicExt + PartialEqVariadic, Schema: 'static + Hash + Eq + Clone + VariadicExt + PartialEqVariadic + SplitBySuffix<(Head, Rest)> + SplitBySuffix<Rest>, <Schema as SplitBySuffix<(Head, Rest)>>::Prefix: Eq + Hash + Clone, <Schema as SplitBySuffix<Rest>>::Prefix: Eq + Hash + Clone, Storage: VariadicCollection<Schema = Schema> + Default + IntoIterator<Item = Schema>, GhtLeaf<Schema, Rest, Storage>: GeneralizedHashTrieNode<Schema = Schema, Storage = Storage>, GhtInner<Head, GhtLeaf<Schema, Rest, Storage>>: GeneralizedHashTrieNode<Schema = Schema, Storage = Storage>,

source§

type Force = GhtInner<Head, GhtLeaf<Schema, Rest, Storage>>