Layer

Struct Layer 

Source
pub struct Layer<K, L, O = usize>
where K: DataTrait + ?Sized, O: 'static, L: Trie,
{ /* private fields */ }
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]].

Implementations§

Source§

impl<K: DataTrait + ?Sized, L, O: 'static> Layer<K, L, O>
where L: Trie,

Source

pub fn from_parts( factories: &LayerFactories<K, <L as Trie>::Factories>, keys: Box<DynVec<K>>, offs: Vec<O>, vals: L, ) -> Self
where O: OrdOffset,

Create a new OrderedLayer from its component parts

Source

pub fn sample_keys<RG>( &self, rng: &mut RG, sample_size: usize, output: &mut DynVec<K>, )
where RG: Rng,

Compute a random sample of size sample_size of keys in self.keys.

Pushes the random sample of keys to the output vector in ascending order.

Trait Implementations§

Source§

impl<K, L, O> AddAssignByRef for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie, O: OrdOffset,

Source§

fn add_assign_by_ref(&mut self, other: &Self)

Source§

impl<K, L, O> AddByRef for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie, O: OrdOffset,

Source§

fn add_by_ref(&self, rhs: &Self) -> Self

Source§

impl<K, L, O> Archive for Layer<K, L, O>
where K: DataTrait + ?Sized, O: 'static, L: Trie + Archive, LayerFactories<K, <L as Trie>::Factories>: Archive, Box<DynVec<K>>: Archive, Vec<O>: Archive,

Source§

type Archived = ArchivedLayer<K, L, O>

The archived representation of this type. Read more
Source§

type Resolver = LayerResolver<K, L, O>

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
Source§

unsafe fn resolve( &self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
Source§

impl<K, L, O> Clone for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie + Clone, O: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate 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> Debug for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie + Debug, O: 'static + Debug,

Source§

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

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

impl<K, L, O> Display for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie, for<'a> L::Cursor<'a>: Clone + Display, O: OrdOffset,

Source§

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

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

impl<K, L, O> Neg for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie + Neg<Output = L>, O: OrdOffset,

Source§

type Output = Layer<K, L, O>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<K, L, O> NegByRef for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie + NegByRef, O: OrdOffset,

Source§

fn neg_by_ref(&self) -> Self

Source§

impl<K, L, O> NumEntries for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie + NumEntries, O: OrdOffset,

Source§

const CONST_NUM_ENTRIES: Option<usize> = None

Returns Some(n) if Self has constant size or None otherwise.
Source§

fn num_entries_shallow(&self) -> usize

Returns the number of entries in self.
Source§

fn num_entries_deep(&self) -> usize

Recursively computes the number of entries in a container by calling this method on each entry in self. Read more
Source§

impl<K, L, O> PartialEq for Layer<K, L, O>
where K: DataTrait + ?Sized, O: OrdOffset, L: Trie + PartialEq,

Source§

fn eq(&self, other: &Self) -> 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<__S: Fallible + ?Sized, K, L, O> Serialize<__S> for Layer<K, L, O>
where K: DataTrait + ?Sized, O: 'static, L: Trie + Serialize<__S>, LayerFactories<K, <L as Trie>::Factories>: Serialize<__S>, Box<DynVec<K>>: Serialize<__S>, Vec<O>: Serialize<__S>,

Source§

fn serialize(&self, serializer: &mut __S) -> Result<Self::Resolver, __S::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Source§

impl<K, L, O> SizeOf for Layer<K, L, O>
where K: DataTrait + ?Sized, O: 'static, L: Trie + SizeOf, Box<DynVec<K>>: SizeOf, Vec<O>: SizeOf,

Source§

fn size_of_children(&self, context: &mut Context)

Gets the size of all “children” owned by this value, not including the size of the value itself. Read more
Source§

fn size_of(&self) -> TotalSize

Gets the total size of the current value
Source§

fn size_of_with_context(&self, context: &mut Context)

Adds the size of the current value to the given Context, including both the size of the value itself and all of its children
Source§

impl<K, L, O> Trie for Layer<K, L, O>
where K: DataTrait + ?Sized, L: Trie, O: OrdOffset,

Source§

type Item<'a> = (&'a mut K, <L as Trie>::Item<'a>)

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

type ItemRef<'a> = (&'a K, <L as Trie>::ItemRef<'a>)

Source§

type Factories = LayerFactories<K, <L as Trie>::Factories>

Source§

type Cursor<'s> = LayerCursor<'s, K, L, O> where K: 's, O: 's, L: 's

The type of cursor used to navigate the type.
Source§

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

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

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

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

type LeafKey = <L as Trie>::LeafKey

The key type of the leaf sub-trie of this trie.
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 approximate_byte_size(&self) -> usize

Compute an approximate byte size of the collection.
Source§

fn is_empty(&self) -> bool

True if self.keys() is zero.
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, O> Eq for Layer<K, L, O>
where K: DataTrait + ?Sized, O: OrdOffset, L: Trie + Eq,

Auto Trait Implementations§

§

impl<K, L, O> Freeze for Layer<K, L, O>
where L: Freeze, <L as Trie>::Factories: Freeze, K: ?Sized,

§

impl<K, L, O = usize> !RefUnwindSafe for Layer<K, L, O>

§

impl<K, L, O> Send for Layer<K, L, O>
where L: Send, <L as Trie>::Factories: Send, O: Send, K: ?Sized,

§

impl<K, L, O> Sync for Layer<K, L, O>
where L: Sync, <L as Trie>::Factories: Sync, O: Sync, K: ?Sized,

§

impl<K, L, O> Unpin for Layer<K, L, O>
where L: Unpin, <L as Trie>::Factories: Unpin, O: Unpin, K: ?Sized,

§

impl<K, L, O = usize> !UnwindSafe for Layer<K, L, O>

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> AsAny for T
where T: 'static,

Source§

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

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> CustomError for T
where T: Display + Debug + Send + Sync + 'static,

Source§

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

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + Send + Sync + 'static)

Source§

fn as_box_any(self: Box<T>) -> Box<dyn Any + Send + Sync>

Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

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

Source§

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

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

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

Source§

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

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

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

Source§

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

Compare self to key and return true if they are equal.
Source§

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

Source§

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

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

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

Source§

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

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Data for T
where T: Clone + 'static,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> SemigroupValue for T
where T: Clone + Eq + SizeOf + AddByRef + AddAssignByRef + 'static,