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

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

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

Methods

impl<T> SmallVector<T>

fn zero() -> SmallVector<T>

fn one(v: T) -> SmallVector<T>

fn many(vs: Vec<T>) -> SmallVector<T>

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

fn pop(&mut self) -> Option<T>

fn push(&mut self, v: T)

fn push_all(&mut self, other: SmallVector<T>)

fn get(&self, idx: usize) -> &T

fn expect_one(self, err: &'static str) -> T

fn len(&self) -> usize

fn is_empty(&self) -> bool

Trait Implementations

impl<T> FromIterator<T> for SmallVector<T>

fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> SmallVector<T>

impl<T> Extend<T> for SmallVector<T>

fn extend<I: IntoIterator<Item=T>>(&mut self, iter: I)

impl<T> IntoIterator for SmallVector<T>

type Item = T

type IntoIter = IntoIter<T>

fn into_iter(self) -> Self::IntoIter

impl<T> MoveMap<T> for SmallVector<T>

fn move_flat_map<F, I>(self, f: F) -> Self where F: FnMut(T) -> I, I: IntoIterator<Item=T>

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