Struct lattices::ght::GhtLeaf

source ·
pub struct GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash, Storage: VariadicCollection<Schema = Schema>,
{ /* private fields */ }
Expand description

leaf node of a HashTrie

Trait Implementations§

source§

impl<Schema, ValType: Clone, Storage> Clone for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash + Clone, Storage: VariadicCollection<Schema = Schema> + Clone,

source§

fn clone(&self) -> GhtLeaf<Schema, ValType, Storage>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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>>

result of forceing a node
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<GhtInner<Head, GhtLeaf<Schema, Rest, Storage>>>

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

impl<Schema, ValType: Debug, Storage> Debug for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash + Debug, Storage: VariadicCollection<Schema = Schema> + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Schema, ValType, Storage> Default for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash, Storage: VariadicCollection<Schema = Schema> + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Schema, ValType, Storage> FromIterator<Schema> for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash, Storage: VariadicCollection<Schema = Schema> + Default + FromIterator<Schema>,

source§

fn from_iter<Iter: IntoIterator<Item = Schema>>(iter: Iter) -> Self

Creates a value from an iterator. Read more
source§

impl<Schema, Storage> GeneralizedHashTrieNode for GhtLeaf<Schema, (), Storage>
where Schema: 'static + Eq + VariadicExt + Hash + Clone + PartialEqVariadic, Storage: VariadicCollection<Schema = Schema> + Default + IntoIterator<Item = Schema>,

source§

type Schema = Schema

Schema variadic: the schema of the relation stored in this trie.
source§

type SuffixSchema = ()

SuffixSchema variadic: the suffix of Self::Schema from this node of the trie downward. The first entry in this variadic is of type Self::Head.
source§

type ValType = ()

The suffix of columns in Self::Schema that are not part of the trie keys
source§

type KeyType = Schema

The prefix of columns in Self::Schema that the trie is keyed on
source§

type Head = ()

The first field in Self::SuffixSchema, and the key for the next node in the trie.
source§

type Storage = Storage

The type that holds the data in the leaves
source§

fn new_from(input: impl IntoIterator<Item = Self::Schema>) -> Self

Create a new Ght from the iterator.
source§

fn merge_node(&mut self, other: Self) -> bool

Merge a matching Ght node into this node
source§

const HEIGHT: usize = 0usize

The height of this node in the GhT. Leaf = 0.
source§

fn insert(&mut self, row: Self::Schema) -> bool

Inserts an item into the hash trie.
source§

fn contains<'a>( &'a self, row: <Self::Schema as VariadicExt>::AsRefVar<'a>, ) -> bool

Returns true if the (entire) row is found below in the trie, false otherwise. See GhtGet::get to look just for “head” keys in this node
source§

fn recursive_iter( &self, ) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>

Iterate through (entire) rows stored in this HashTrie.
source§

fn find_containing_leaf( &self, row: <Self::Schema as VariadicExt>::AsRefVar<'_>, ) -> Option<&GhtLeaf<<Self as GeneralizedHashTrieNode>::Schema, Self::ValType, Self::Storage>>

return the leaf below that contains this row, or None if not found.
source§

fn into_iter(self) -> Option<impl Iterator<Item = Self::Schema>>

into_iter for leaf elements, or None for inner nodes
source§

fn drain(&mut self) -> Option<impl Iterator<Item = Self::Schema>>

pull all the data out of this trie node but retain the reference
source§

fn height(&self) -> usize

Report the height of this node. This is the length of path from this node to a leaf - 1. E.g. if we have GhtInner<GhtInner<GhtLeaf…>> the height is 2 This is a static property of the type of this node, so simply invokes the static method.
source§

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

source§

type Schema = Schema

Schema variadic: the schema of the relation stored in this trie.
source§

type SuffixSchema = (ValHead, ValRest)

SuffixSchema variadic: the suffix of Self::Schema from this node of the trie downward. The first entry in this variadic is of type Self::Head.
source§

type ValType = (ValHead, ValRest)

The suffix of columns in Self::Schema that are not part of the trie keys
source§

type KeyType = <Schema as SplitBySuffix<(ValHead, ValRest)>>::Prefix

The prefix of columns in Self::Schema that the trie is keyed on
source§

type Head = ValHead

The first field in Self::SuffixSchema, and the key for the next node in the trie.
source§

type Storage = Storage

The type that holds the data in the leaves
source§

fn new_from(input: impl IntoIterator<Item = Self::Schema>) -> Self

Create a new Ght from the iterator.
source§

fn merge_node(&mut self, other: Self) -> bool

Merge a matching Ght node into this node
source§

const HEIGHT: usize = 0usize

The height of this node in the GhT. Leaf = 0.
source§

fn insert(&mut self, row: Self::Schema) -> bool

Inserts an item into the hash trie.
source§

fn contains<'a>( &'a self, row: <Self::Schema as VariadicExt>::AsRefVar<'a>, ) -> bool

Returns true if the (entire) row is found below in the trie, false otherwise. See GhtGet::get to look just for “head” keys in this node
source§

fn recursive_iter( &self, ) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>

Iterate through (entire) rows stored in this HashTrie.
source§

fn find_containing_leaf( &self, row: <Self::Schema as VariadicExt>::AsRefVar<'_>, ) -> Option<&GhtLeaf<<Self as GeneralizedHashTrieNode>::Schema, Self::ValType, Self::Storage>>

return the leaf below that contains this row, or None if not found.
source§

fn into_iter(self) -> Option<impl Iterator<Item = Self::Schema>>

into_iter for leaf elements, or None for inner nodes
source§

fn drain(&mut self) -> Option<impl Iterator<Item = Self::Schema>>

pull all the data out of this trie node but retain the reference
source§

fn height(&self) -> usize

Report the height of this node. This is the length of path from this node to a leaf - 1. E.g. if we have GhtInner<GhtInner<GhtLeaf…>> the height is 2 This is a static property of the type of this node, so simply invokes the static method.
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>

Type returned by Self::get.

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).
source§

impl<KeyPrefixRef, Schema, ValType, Storage> GhtPrefixIter<KeyPrefixRef> for GhtLeaf<Schema, ValType, Storage>
where KeyPrefixRef: 'static + RefVariadic, Schema: 'static + VariadicExt + Hash + Eq + SplitBySuffix<ValType>, ValType: VariadicExt + Split<KeyPrefixRef::UnRefVar>, KeyPrefixRef::UnRefVar: PartialEqVariadic, Storage: 'static + VariadicCollection<Schema = Schema>,

source§

type Item = Schema

the schema output
source§

fn prefix_iter<'a>( &'a self, prefix: KeyPrefixRef, ) -> impl Iterator<Item = <Self::Item as VariadicExt>::AsRefVar<'a>>
where Self::Item: 'a,

given a prefix, return an iterator through the items below
source§

impl<Schema, SuffixSchema, Storage> IsBot for GhtLeaf<Schema, SuffixSchema, Storage>
where Schema: Eq + Hash, SuffixSchema: Eq + Hash, Storage: VariadicSet<Schema = Schema>,

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl<Schema, SuffixSchema, Storage> IsTop for GhtLeaf<Schema, SuffixSchema, Storage>
where Schema: Eq + Hash, SuffixSchema: Eq + Hash, Storage: VariadicSet<Schema = Schema>,

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl<Schema, ValType, Storage> Merge<GhtLeaf<Schema, ValType, Storage>> for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash, Storage: VariadicSet<Schema = Schema> + Extend<Schema> + IntoIterator<Item = Schema>,

source§

fn merge(&mut self, other: GhtLeaf<Schema, ValType, Storage>) -> bool

Merge other into the self lattice. Read more
source§

fn merge_owned(this: Self, delta: Other) -> Self
where Self: Sized,

Merge this and delta together, returning the new value.
source§

impl<Schema, ValType: PartialEq, Storage> PartialEq for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash + PartialEq, Storage: VariadicCollection<Schema = Schema> + PartialEq,

source§

fn eq(&self, other: &GhtLeaf<Schema, ValType, Storage>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Schema, SuffixSchema, Storage> PartialOrd for GhtLeaf<Schema, SuffixSchema, Storage>
where Schema: Eq + Hash + PartialEqVariadic, SuffixSchema: Eq + Hash, Storage: VariadicSet<Schema = Schema> + PartialEq,

source§

fn partial_cmp( &self, other: &GhtLeaf<Schema, SuffixSchema, Storage>, ) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Schema, ValType: Eq, Storage> Eq for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash + Eq, Storage: VariadicCollection<Schema = Schema> + Eq,

source§

impl<Schema, SuffixSchema, Storage> LatticeOrd for GhtLeaf<Schema, SuffixSchema, Storage>
where Schema: Eq + Hash + PartialEqVariadic, SuffixSchema: Eq + Hash, Storage: VariadicSet<Schema = Schema> + PartialEq,

source§

impl<Schema, ValType, Storage> StructuralPartialEq for GhtLeaf<Schema, ValType, Storage>
where Schema: Eq + Hash, Storage: VariadicCollection<Schema = Schema>,

Auto Trait Implementations§

§

impl<Schema, ValType, Storage> Freeze for GhtLeaf<Schema, ValType, Storage>
where Storage: Freeze,

§

impl<Schema, ValType, Storage> RefUnwindSafe for GhtLeaf<Schema, ValType, Storage>
where Storage: RefUnwindSafe, ValType: RefUnwindSafe,

§

impl<Schema, ValType, Storage> Send for GhtLeaf<Schema, ValType, Storage>
where Storage: Send, ValType: Send,

§

impl<Schema, ValType, Storage> Sync for GhtLeaf<Schema, ValType, Storage>
where Storage: Sync, ValType: Sync,

§

impl<Schema, ValType, Storage> Unpin for GhtLeaf<Schema, ValType, Storage>
where Storage: Unpin, ValType: Unpin,

§

impl<Schema, ValType, Storage> UnwindSafe for GhtLeaf<Schema, ValType, Storage>
where Storage: UnwindSafe, ValType: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<This, Other> NaiveLatticeOrd<Other> for This
where This: Clone + Merge<Other>, Other: Clone + Merge<This>,

source§

fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>

Naive compare based on the Merge::merge method. This method can be very inefficient; use PartialOrd::partial_cmp instead. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Lattice for T