Struct differential_dataflow::trace::layers::hashed::HashedLayer
source · pub struct HashedLayer<K: HashOrdered, L> {
pub keys: Vec<Entry<K>>,
pub vals: L,
}Expand description
A level of the trie, with keys and offsets into a lower layer.
If keys[i].1 == 0 then entry i should
be ignored. This is our version of Option<(K, usize)>, which comes at the cost
of requiring K: Default to populate empty keys.
Each region of this layer is an independent immutable RHH map, whose size should
equal something like (1 << i) + i for some value of i. The first (1 << i)
elements are where we expect to find keys, and the remaining i are for spill-over
due to collisions near the end of the first region.
We might do something like “if X or fewer elements, just use an ordered list”.
Fields
keys: Vec<Entry<K>>Keys and offsets for the keys.
vals: LA lower layer containing ranges of values.
Trait Implementations
sourceimpl<K: HashOrdered, L: Trie> Cursor<HashedLayer<K, L>> for HashedCursor<L>
impl<K: HashOrdered, L: Trie> Cursor<HashedLayer<K, L>> for HashedCursor<L>
type Key = K
type Key = K
The type revealed by the cursor.
sourcefn key<'a>(&self, storage: &'a HashedLayer<K, L>) -> &'a Self::Key
fn key<'a>(&self, storage: &'a HashedLayer<K, L>) -> &'a Self::Key
Reveals the current key.
sourcefn step(&mut self, storage: &HashedLayer<K, L>)
fn step(&mut self, storage: &HashedLayer<K, L>)
Advances the cursor by one element.
sourcefn seek(&mut self, storage: &HashedLayer<K, L>, key: &Self::Key)
fn seek(&mut self, storage: &HashedLayer<K, L>, key: &Self::Key)
Advances the cursor until the location where
key would be expected.sourcefn valid(&self, _storage: &HashedLayer<K, L>) -> bool
fn valid(&self, _storage: &HashedLayer<K, L>) -> bool
Returns
true if the cursor points at valid data. Returns false if the cursor is exhausted.sourcefn rewind(&mut self, storage: &HashedLayer<K, L>)
fn rewind(&mut self, storage: &HashedLayer<K, L>)
Rewinds the cursor to its initial state.
sourcefn reposition(&mut self, storage: &HashedLayer<K, L>, lower: usize, upper: usize)
fn reposition(&mut self, storage: &HashedLayer<K, L>, lower: usize, upper: usize)
Repositions the cursor to a different range of values.
sourceimpl<K: Debug + HashOrdered, L: Debug> Debug for HashedLayer<K, L>
impl<K: Debug + HashOrdered, L: Debug> Debug for HashedLayer<K, L>
sourceimpl<K: Clone + HashOrdered + Default, L: Trie> Trie for HashedLayer<K, L>
impl<K: Clone + HashOrdered + Default, L: Trie> Trie for HashedLayer<K, L>
type Cursor = HashedCursor<L>
type Cursor = HashedCursor<L>
The type of cursor used to navigate the type.
type MergeBuilder = HashedBuilder<K, <L as Trie>::MergeBuilder>
type MergeBuilder = HashedBuilder<K, <L as Trie>::MergeBuilder>
The type used to merge instances of the type together.
type TupleBuilder = HashedBuilder<K, <L as Trie>::TupleBuilder>
type TupleBuilder = HashedBuilder<K, <L as Trie>::TupleBuilder>
The type used to assemble instances of the type from its
Items.sourcefn keys(&self) -> usize
fn keys(&self) -> usize
The number of distinct keys, as distinct from the total number of tuples.
Auto Trait Implementations
impl<K, L> RefUnwindSafe for HashedLayer<K, L>where
K: RefUnwindSafe,
L: RefUnwindSafe,
impl<K, L> Send for HashedLayer<K, L>where
K: Send,
L: Send,
impl<K, L> Sync for HashedLayer<K, L>where
K: Sync,
L: Sync,
impl<K, L> Unpin for HashedLayer<K, L>where
K: Unpin,
L: Unpin,
impl<K, L> UnwindSafe for HashedLayer<K, L>where
K: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more