Skip to main content

SingletonHashTrieIter

Struct SingletonHashTrieIter 

Source
pub struct SingletonHashTrieIter { /* private fields */ }
Expand description

A singleton “hash trie” containing one value.

Implements HashTrieIterator over a single-value relation. Used by the const-view rewrite to expose a Const_c<id> = {c<id>} predicate as if it were a real hash-trie-backed relation.

Implementations§

Source§

impl SingletonHashTrieIter

Source

pub fn new(value: usize, hash: u64) -> Self

Construct a new singleton positioned at its root (pre-open).

hash is the precomputed u64 hash of value under whichever kermit_iters::HashStrategy the caller uses for the matching HashTrie<H>. Keeping the strategy out of this struct lets the singleton remain Sized without a phantom parameter and lets a generic caller (e.g. hash_join<R, H>) drive both the trie and the singleton with the same hash function.

Trait Implementations§

Source§

impl Clone for SingletonHashTrieIter

Source§

fn clone(&self) -> SingletonHashTrieIter

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SingletonHashTrieIter

Source§

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

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

impl HashTrieIterable for SingletonHashTrieIter

Source§

fn hash_trie_iter(&self) -> impl HashTrieIterator

Returns a HashTrieIterator over this structure.
Source§

impl HashTrieIterator for SingletonHashTrieIter

Source§

fn key(&self) -> Option<u64>

Hash at the current bucket, or None if at end or not yet opened.
Source§

fn next(&mut self) -> Option<u64>

Advance to the next occupied bucket. Returns its hash, or None if no further bucket exists at this level.
Source§

fn lookup(&mut self, hash: u64) -> bool

Position at the bucket with exact hash hash. Returns true iff a matching bucket exists.
Source§

fn size(&self) -> usize

Number of occupied buckets in the current node — the paper’s size(I_j). Used by the algorithm to pick the smallest table at each level (argmin size).
Source§

fn at_end(&self) -> bool

true iff the iterator is positioned past the last occupied bucket in the current node.
Source§

fn open(&mut self) -> bool

Descend into the child node at the current bucket. Returns false if already at the leaf level or if the current bucket is empty.
Source§

fn up(&mut self) -> bool

Ascend to the parent node. Returns false at the root.
Source§

fn leaf_tuples(&self) -> Option<&[Vec<usize>]>

Tuple chain at the current leaf bucket. Returns Some(&[…]) iff the current node is a leaf and the current bucket is occupied; otherwise None.
Source§

impl JoinIterable for SingletonHashTrieIter

Auto Trait Implementations§

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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.