[][src]Struct syntex_syntax2::util::small_vector::SmallVector

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

A vector type optimized for cases where the size is almost always 0 or 1

Methods

impl<T> SmallVector<T>[src]

pub fn new() -> SmallVector<T>[src]

pub fn zero() -> SmallVector<T>[src]

pub fn one(v: T) -> SmallVector<T>[src]

pub fn many(vs: Vec<T>) -> SmallVector<T>[src]

pub fn as_slice(&self) -> &[T][src]

pub fn as_mut_slice(&mut self) -> &mut [T][src]

pub fn pop(&mut self) -> Option<T>[src]

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

pub fn push_all(&mut self, other: SmallVector<T>)[src]

pub fn get(&self, idx: usize) -> &T[src]

pub fn expect_one(self, err: &'static str) -> T[src]

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

pub fn is_empty(&self) -> bool[src]

pub fn map<U, F: FnMut(T) -> U>(self, f: F) -> SmallVector<U>[src]

Trait Implementations

impl<T> MoveMap<T> for SmallVector<T>[src]

fn move_map<F>(self, f: F) -> Self where
    F: FnMut(T) -> T, 
[src]

impl<T: Clone> Clone for SmallVector<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Into<Vec<T>> for SmallVector<T>[src]

impl<T> Extend<T> for SmallVector<T>[src]

impl<T> IntoIterator for SmallVector<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

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

impl<T> DerefMut for SmallVector<T>[src]

impl<T> Deref for SmallVector<T>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T> FromIterator<T> for SmallVector<T>[src]

Auto Trait Implementations

impl<T> Sync for SmallVector<T> where
    T: Sync

impl<T> Unpin for SmallVector<T> where
    T: Unpin

impl<T> Send for SmallVector<T> where
    T: Send

impl<T> UnwindSafe for SmallVector<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for SmallVector<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

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