[][src]Struct rate_common::memory::Vector

pub struct Vector<T>(_);

A contiguous growable array type like std::vec::Vec

This should expose a subset of the std::vec::Vec API to facilitate switching between implementations.

The difference to std::vec::Vec is mostly that Vector uses a different growth factor (1.5 instead of 2) and disable bounds checking by default.

Methods

impl<T> Vector<T>[src]

pub fn from_vec(vec: Vec<T>) -> Vector<T>[src]

Wrap a std::vec::Vec.

pub fn into_vec(self) -> Vec<T>[src]

Convert to a std::vec::Vec.

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

pub fn with_capacity(capacity: usize) -> Vector<T>[src]

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

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

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

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

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

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

pub fn iter(&self) -> Iter<T>[src]

pub fn as_ptr(&self) -> *const T[src]

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

pub fn truncate(&mut self, new_length: usize)[src]

pub fn clear(&mut self)[src]

pub fn shrink_to_fit(&mut self)[src]

pub fn push_no_grow(&mut self, value: T)[src]

Like push but do not grow the vector.

This must only be called when there is enough space left for the new element.

impl<T: Clone + Default> Vector<T>[src]

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

pub fn fill(size: usize, default_value: T) -> Vector<T>[src]

impl<T: Copy> Vector<T>[src]

pub fn swap_remove(&mut self, index: usize) -> T[src]

impl<T: Ord> Vector<T>[src]

impl<T> Vector<T>[src]

pub fn sort_unstable_by_key<F, K>(&mut self, f: F) where
    F: FnMut(&T) -> K,
    K: Ord
[src]

impl<T: Clone + Default> Vector<T>[src]

pub fn resize(&mut self, new_length: usize)[src]

Trait Implementations

impl<T: HeapSpace> HeapSpace for Vector<T>[src]

impl<T: Eq> Eq for Vector<T>[src]

impl<T> AsMut<Vector<T>> for Vector<T>[src]

impl<T> AsMut<[T]> for Vector<T>[src]

impl<T: Default> Default for Vector<T>[src]

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

impl<T> AsRef<Vector<T>> for Vector<T>[src]

impl<T> AsRef<[T]> for Vector<T>[src]

impl<T: PartialEq> PartialEq<Vector<T>> for Vector<T>[src]

impl<'a, T> IntoIterator for &'a Vector<T>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

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

type Item = T

The type of the elements being iterated over.

type IntoIter = <Vec<T> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

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

type Target = [T]

The resulting type after dereferencing.

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

impl<T> Index<usize> for Vector<T>[src]

type Output = T

The returned type after indexing.

impl<T> Index<Range<usize>> for Vector<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> IndexMut<usize> for Vector<T>[src]

impl<T> IndexMut<Range<usize>> for Vector<T>[src]

impl<T: Debug> Debug for Vector<T>[src]

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

impl<T: Clone + Serialize> Serialize for Vector<T>[src]

impl<'de, T: Clone + Deserialize<'de>> Deserialize<'de> for Vector<T>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T> HeapSpace for T where
    T: Copy
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<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> From<T> for T[src]

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]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]