pub struct OrderedLayer<K, L, O = usize, C = Vec<K>>where
    K: Ord,
    C: BatchContainer<Item = K>,
    O: OrdOffset,{
    pub keys: C,
    pub offs: Vec<O>,
    pub vals: L,
}
Expand description

A level of the trie, with keys and offsets into a lower layer.

In this representation, the values for keys[i] are found at vals[offs[i] .. offs[i+1]].

Fields§

§keys: C

The keys of the layer.

§offs: Vec<O>

The offsets associate with each key.

The bounds for keys[i] are (offs[i], offs[i+1]). The offset array is guaranteed to be one element longer than the keys array, ensuring that these accesses do not panic.

§vals: L

The ranges of values associated with the keys.

Trait Implementations§

source§

impl<K, L, O, C> Abomonation for OrderedLayer<K, L, O, C>where K: Ord, C: BatchContainer<Item = K> + Abomonation, O: OrdOffset + Abomonation, Vec<O>: Abomonation, L: Abomonation,

source§

unsafe fn entomb<W: Write>(&self, _write: &mut W) -> Result<()>

Write any additional information about &self beyond its binary representation. Read more
source§

fn extent(&self) -> usize

Reports the number of further bytes required to entomb self.
source§

unsafe fn exhume<'a, 'b>( &'a mut self, bytes: &'b mut [u8] ) -> Option<&'b mut [u8]>

Recover any information for &mut self not evident from its binary representation. Read more
source§

impl<K, L: Clone, O, C> Clone for OrderedLayer<K, L, O, C>where K: Ord + Clone, C: BatchContainer<Item = K> + Clone, O: OrdOffset + Clone,

source§

fn clone(&self) -> OrderedLayer<K, L, O, C>

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<K, L, O, C> Cursor<OrderedLayer<K, L, O, C>> for OrderedCursor<L>where K: Ord, C: BatchContainer<Item = K>, L: Trie, O: OrdOffset,

§

type Key = K

The type revealed by the cursor.
source§

fn key<'a>(&self, storage: &'a OrderedLayer<K, L, O, C>) -> &'a Self::Key

Reveals the current key.
source§

fn step(&mut self, storage: &OrderedLayer<K, L, O, C>)

Advances the cursor by one element.
source§

fn seek(&mut self, storage: &OrderedLayer<K, L, O, C>, key: &Self::Key)

Advances the cursor until the location where key would be expected.
source§

fn valid(&self, _storage: &OrderedLayer<K, L, O, C>) -> bool

Returns true if the cursor points at valid data. Returns false if the cursor is exhausted.
source§

fn rewind(&mut self, storage: &OrderedLayer<K, L, O, C>)

Rewinds the cursor to its initial state.
source§

fn reposition( &mut self, storage: &OrderedLayer<K, L, O, C>, lower: usize, upper: usize )

Repositions the cursor to a different range of values.
source§

impl<K, L: Debug, O, C> Debug for OrderedLayer<K, L, O, C>where K: Ord + Debug, C: BatchContainer<Item = K> + Debug, O: OrdOffset + Debug,

source§

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

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

impl<K, L: PartialEq, O, C> PartialEq for OrderedLayer<K, L, O, C>where K: Ord + PartialEq, C: BatchContainer<Item = K> + PartialEq, O: OrdOffset + PartialEq,

source§

fn eq(&self, other: &OrderedLayer<K, L, O, C>) -> bool

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

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

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

impl<K, L, O, C> Trie for OrderedLayer<K, L, O, C>where K: Ord + Clone, C: BatchContainer<Item = K>, L: Trie, O: OrdOffset,

§

type Item = (K, <L as Trie>::Item)

The type of item from which the type is constructed.
§

type Cursor = OrderedCursor<L>

The type of cursor used to navigate the type.
§

type MergeBuilder = OrderedBuilder<K, <L as Trie>::MergeBuilder, O, C>

The type used to merge instances of the type together.
§

type TupleBuilder = OrderedBuilder<K, <L as Trie>::TupleBuilder, O, C>

The type used to assemble instances of the type from its Items.
source§

fn keys(&self) -> usize

The number of distinct keys, as distinct from the total number of tuples.
source§

fn tuples(&self) -> usize

The total number of tuples in the collection.
source§

fn cursor_from(&self, lower: usize, upper: usize) -> Self::Cursor

Returns a cursor over a range of data, commonly used by others to restrict navigation to sub-collections.
source§

fn cursor(&self) -> Self::Cursor

Returns a cursor capable of navigating the collection.
source§

fn merge(&self, other: &Self) -> Self

Merges two collections into a third. Read more
source§

impl<K, L: Eq, O, C> Eq for OrderedLayer<K, L, O, C>where K: Ord + Eq, C: BatchContainer<Item = K> + Eq, O: OrdOffset + Eq,

source§

impl<K, L, O, C> StructuralEq for OrderedLayer<K, L, O, C>where K: Ord, C: BatchContainer<Item = K>, O: OrdOffset,

source§

impl<K, L, O, C> StructuralPartialEq for OrderedLayer<K, L, O, C>where K: Ord, C: BatchContainer<Item = K>, O: OrdOffset,

Auto Trait Implementations§

§

impl<K, L, O, C> RefUnwindSafe for OrderedLayer<K, L, O, C>where C: RefUnwindSafe, L: RefUnwindSafe, O: RefUnwindSafe,

§

impl<K, L, O, C> Send for OrderedLayer<K, L, O, C>where C: Send, L: Send, O: Send,

§

impl<K, L, O, C> Sync for OrderedLayer<K, L, O, C>where C: Sync, L: Sync, O: Sync,

§

impl<K, L, O, C> Unpin for OrderedLayer<K, L, O, C>where C: Unpin, L: Unpin, O: Unpin,

§

impl<K, L, O, C> UnwindSafe for OrderedLayer<K, L, O, C>where C: UnwindSafe, L: UnwindSafe, O: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> PreferredContainer for Twhere T: Clone,

§

type Container = Vec<T>

The preferred container for the type.
source§

impl<T> ProgressEventTimestamp for Twhere T: Data + Debug + Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Upcasts this ProgressEventTimestamp to Any. Read more
source§

fn type_name(&self) -> &'static str

Returns the name of the concrete type of this object. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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> Data for Twhere T: Clone + 'static,