Struct pinned_vec::PinnedVec[][src]

pub struct PinnedVec<T> { /* fields omitted */ }
Expand description

Vec-like structure whose elements never move.

Implementations

Create a new, empty PinnedVec. This method does not allocate.

Get the length of the PinnedVec (the number of elements inside).

Get the current capacity of the PinnedVec Pushing within capacity means no extra allocation. Pushing over capacity will cause allocation, increasing capacity.

Get a pinned reference to the element at the specified index, if it exists.

Get a pinned mutable reference to the element at the specified index, if it exists.

Push an element to the end of the PinnedVec. Might cause the PinnedVec to allocate a new sub-vector.

Remove the last element in the PinnedVec. The element is not returned because that would violate Pin invariant.

Panics

Panics if the vec is empty.

Replace the element at the specified index with another one. The element is not returned because that would violate Pin invariant.

Panics

Panics if index is not in the vec (i.e. len >= index).

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 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.