Struct elsa::vec::FrozenVec [−][src]
pub struct FrozenVec<T> { /* fields omitted */ }
Expand description
Append-only version of std::vec::Vec
where
insertion does not require mutable access
Implementations
Push, immediately getting a reference to the 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 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.
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.