pub struct RawVec<T, S: Storage> { /* private fields */ }
Expand description

A raw vec around some slice storage. Bundles the storage and its handle.

Note that this is even lower level than alloc’s RawVec currently. That raw vec handles amortized growth; this raw vec just does exactly as asked.

Implementations

Create a new empty growable slice in the given storage.

Get a reference to the boxed slice.

Get a mutable reference to the boxed slice.

Get the length of the slice.

Grow the length of the slice to new_len. Does not change the length if the slice is already long enough. Does not do amortization.

Shrink the length of the slice to new_len. Does not change the length if the slice is already shorter than the given length.

Trait Implementations

Executes the destructor for this 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.