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>
[src]

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

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

Trait Implementations

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

fn into(self) -> Vec<T>

Performs the conversion.

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

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

Creates a value from an iterator. Read more

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

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

Extends a collection with the contents of an iterator. Read more

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?

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

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

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