[−][src]Enum rate_common::memory::SmallVector
A Vector with small-buffer-optimization
Variants
Empty variant, no need to allocate anything (same as Vector)
A SmallVector with a single element that is stored in place
Many(Vector<T>)Fallback to a plain Vector, for two or more elements
Methods
impl<T> SmallVector<T>[src]
pub fn len(&self) -> usize[src]
See Vec::len().
pub fn is_empty(&self) -> bool[src]
See Vec::is_empty().
impl<T: Copy + Default> SmallVector<T>[src]
pub fn singleton(value: T) -> SmallVector<T>[src]
Constructs a new SmallVector containing a single element.
pub fn from_vector(vector: Vector<T>) -> SmallVector<T>[src]
Convert a Vector to a SmallVector.
pub fn first(&self) -> Option<T>[src]
See Vec::first().
pub fn push(&mut self, new_value: T)[src]
See Vec::push().
pub fn swap_remove(&mut self, index: usize) -> T[src]
See Vec::swap_remove().
Note: this currently only supports being called with index=0 because that's all we need for parsing.
Trait Implementations
impl<T: Copy + Default> Default for SmallVector<T>[src]
fn default() -> SmallVector<T>[src]
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]
impl<T: PartialEq> PartialEq<SmallVector<T>> for SmallVector<T>[src]
fn eq(&self, other: &SmallVector<T>) -> bool[src]
fn ne(&self, other: &SmallVector<T>) -> bool[src]
impl<T> Index<usize> for SmallVector<T>[src]
type Output = T
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output[src]
impl<T> IndexMut<usize> for SmallVector<T>[src]
impl<T: Debug> Debug for SmallVector<T>[src]
impl<T: Copy + Default> FromIterator<T> for SmallVector<T>[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> SmallVector<T>[src]
Auto Trait Implementations
impl<T> Send for SmallVector<T> where
T: Send,
T: Send,
impl<T> Unpin for SmallVector<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for SmallVector<T> where
T: Sync,
T: Sync,
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> 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> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for 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,