Struct flatvec::FlatVec[][src]

pub struct FlatVec<T, IndexTy: Default, BackingTy, const INDEX_INLINE_LEN: usize> { /* fields omitted */ }
Expand description

An indirection-collapsing container with minimal allocation

Read as “An internally-flattening Vec of T, indexed by IndexTy, where each T is stored as a slice of BackingTy” For simple use cases, you may want a type alias for FlatVec<T, usize, u8, 3>, but under some workloads it is very profitable to pick a smaller IndexTy, possibly even u8, and a corresponding inline capacity.

Implementations

Create a new FlatVec, this is just an alias for the Default implementation.

Returns the number of T in a FlatVec<T>.

Returns the number of BackingTy used to store the elements of a FlatVec. This does not necessarily correlate with storage used to store the indices.

Returns true if the len is 0.

Appends an element to the back of the collection.

Construct a Dest from the indexth element’s stored representation.

Returns an iterator that constructs a Dest from each element’s stored representation.

Removes the indexth element of a FlatVec. This function is O(self.len() + self.data_len()).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.