Struct elsa::vec::FrozenVec[][src]

pub struct FrozenVec<T> { /* fields omitted */ }

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


impl<T> FrozenVec<T>[src]

pub fn new() -> Self[src]

impl<T: StableDeref> FrozenVec<T>[src]

pub fn push(&self, val: T)[src]

pub fn push_get(&self, val: T) -> &T::Target[src]

Push, immediately getting a reference to the element

pub fn get(&self, index: usize) -> Option<&T::Target>[src]

pub fn len(&self) -> usize[src]

pub fn iter(&self) -> Iter<'_, T>

Notable traits for Iter<'a, T>

impl<'a, T: StableDeref> Iterator for Iter<'a, T> type Item = &'a T::Target;

pub fn into_vec(self) -> Vec<T>[src]

pub fn as_mut(&mut self) -> &mut Vec<T>[src]

Get mutable access to the underlying vector.

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

Trait Implementations

impl<T> Default for FrozenVec<T>[src]

impl<T> From<Vec<T, Global>> for FrozenVec<T>[src]

impl<A> FromIterator<A> for FrozenVec<A>[src]

impl<T: StableDeref> Index<usize> for FrozenVec<T>[src]

type Output = T::Target

The returned type after indexing.

impl<'a, T: StableDeref> IntoIterator for &'a FrozenVec<T>[src]

type Item = &'a T::Target

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

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

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.