pub struct FrozenVec<T> { /* private fields */ }
Expand description
Append-only version of std::vec::Vec
where
insertion does not require mutable access
Implementations§
source§impl<T: StableDeref> FrozenVec<T>
impl<T: StableDeref> FrozenVec<T>
sourcepub fn push_get(&self, val: T) -> &T::Target
pub fn push_get(&self, val: T) -> &T::Target
Push, immediately getting a reference to the element
sourcepub unsafe fn get_unchecked(&self, index: usize) -> &T::Target
pub unsafe fn get_unchecked(&self, index: usize) -> &T::Target
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()
source§impl<T: StableDeref> FrozenVec<T>
impl<T: StableDeref> FrozenVec<T>
source§impl<T: StableDeref> FrozenVec<T>
impl<T: StableDeref> FrozenVec<T>
source§impl<T: StableDeref> FrozenVec<T>
impl<T: StableDeref> FrozenVec<T>
sourcepub fn binary_search(&self, x: &T::Target) -> Result<usize, usize>where
T::Target: Ord,
pub fn binary_search(&self, x: &T::Target) -> Result<usize, usize>where T::Target: Ord,
Binary searches this sorted vector for a given element, analogous to slice::binary_search.
sourcepub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where
F: FnMut(&'a T::Target) -> Ordering,
pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where F: FnMut(&'a T::Target) -> Ordering,
Binary searches this sorted vector with a comparator function, analogous to slice::binary_search_by.
sourcepub fn binary_search_by_key<'a, B, F>(
&'a self,
b: &B,
f: F
) -> Result<usize, usize>where
F: FnMut(&'a T::Target) -> B,
B: Ord,
pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F ) -> Result<usize, usize>where F: FnMut(&'a T::Target) -> B, B: Ord,
Binary searches this sorted vector with a key extraction function, analogous to slice::binary_search_by_key.
sourcepub fn partition_point<P>(&self, pred: P) -> usizewhere
P: FnMut(&T::Target) -> bool,
pub fn partition_point<P>(&self, pred: P) -> usizewhere P: FnMut(&T::Target) -> bool,
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§
source§impl<A> FromIterator<A> for FrozenVec<A>
impl<A> FromIterator<A> for FrozenVec<A>
source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = A>,
fn from_iter<T>(iter: T) -> Selfwhere T: IntoIterator<Item = A>,
Creates a value from an iterator. Read more
source§impl<'a, T: StableDeref> IntoIterator for &'a FrozenVec<T>
impl<'a, T: StableDeref> IntoIterator for &'a FrozenVec<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for FrozenVec<T>
impl<T> Send for FrozenVec<T>where T: Send,
impl<T> !Sync for FrozenVec<T>
impl<T> Unpin for FrozenVec<T>where T: Unpin,
impl<T> UnwindSafe for FrozenVec<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more