pub struct FrozenVec<T> { /* private fields */ }
Expand description

Append-only version of std::vec::Vec where insertion does not require mutable access

Implementations

Constructs a new, empty vector.

Appends an element to the back of the vector.

Push, immediately getting a reference to the element

Returns a reference to an element.

Returns a reference to an element, without doing bounds checking.

Safety

index must be in bounds, i.e. it must be less than self.len()

Returns the number of elements in the vector.

Returns true if the vector contains no elements.

Returns the first element of the vector, or None if empty.

Returns the last element of the vector, or None if empty.

Returns an iterator over the vector.

Converts the frozen vector into a plain vector.

Get mutable access to the underlying vector.

This is safe, as it requires a &mut self, ensuring nothing is using the ‘frozen’ contents.

Binary searches this sorted vector for a given element, analogous to slice::binary_search.

Binary searches this sorted vector with a comparator function, analogous to slice::binary_search_by.

Binary searches this sorted vector with a key extraction function, analogous to slice::binary_search_by_key.

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition), analogous to slice::partition_point.

Trait Implementations

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

Performs the conversion.

Creates a value from an iterator. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. 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.