[−][src]Struct syntex_syntax2::util::small_vector::SmallVector
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_flat_map<F, I>(self, f: F) -> Self where
F: FnMut(T) -> I,
I: IntoIterator<Item = T>,
[src]
F: FnMut(T) -> I,
I: IntoIterator<Item = T>,
fn move_map<F>(self, f: F) -> Self where
F: FnMut(T) -> T,
[src]
F: FnMut(T) -> T,
impl<T: Clone> Clone for SmallVector<T>
[src]
fn clone(&self) -> 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]
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
[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?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T> Default for SmallVector<T>
[src]
impl<T> DerefMut for SmallVector<T>
[src]
impl<T> Deref for SmallVector<T>
[src]
impl<T> FromIterator<T> for SmallVector<T>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> SmallVector<T>
[src]
Auto Trait Implementations
impl<T> Sync for SmallVector<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SmallVector<T> where
T: Unpin,
T: Unpin,
impl<T> Send for SmallVector<T> where
T: Send,
T: Send,
impl<T> UnwindSafe for SmallVector<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for SmallVector<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,