[−][src]Struct rate_common::memory::Vector
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]
See Vec::new().
pub fn with_capacity(capacity: usize) -> Vector<T>[src]
See Vec::with_capacity().
pub fn len(&self) -> usize[src]
See Vec::len().
pub fn is_empty(&self) -> bool[src]
See Vec::is_empty().
pub fn capacity(&self) -> usize[src]
See Vec::capacity().
pub fn pop(&mut self) -> Option<T>[src]
See Vec::pop().
pub fn first(&self) -> &T[src]
See Vec::first().
pub fn last(&self) -> &T[src]
See Vec::last().
pub fn iter(&self) -> Iter<T>[src]
See Vec::iter().
pub fn as_ptr(&self) -> *const T[src]
See Vec::as_ptr().
pub fn mut_ptr(&mut self) -> *mut T[src]
See Vec::mut_ptr().
pub fn truncate(&mut self, new_length: usize)[src]
See Vec::truncate().
pub fn clear(&mut self)[src]
See Vec::clear().
pub fn shrink_to_fit(&mut self)[src]
See Vec::shrink_to_fit().
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]
impl<T: Copy> Vector<T>[src]
pub fn swap_remove(&mut self, index: usize) -> T[src]
See Vec::swap_remove().
impl<T: Ord> Vector<T>[src]
pub fn sort_unstable(&mut self)[src]
See Vec::sort_unstable().
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]
F: FnMut(&T) -> K,
K: Ord,
impl<T: Clone + Default> Vector<T>[src]
pub fn resize(&mut self, new_length: usize)[src]
See Vec::resize().
Trait Implementations
impl<T: HeapSpace> HeapSpace for Vector<T>[src]
fn heap_space(&self) -> usize[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?
fn into_iter(self) -> Self::IntoIter[src]
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?
fn into_iter(self) -> Self::IntoIter[src]
impl<T> Deref for Vector<T>[src]
impl<T> DerefMut for Vector<T>[src]
impl<T> Index<usize> for Vector<T>[src]
type Output = T
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output[src]
impl<T> Index<Range<usize>> for Vector<T>[src]
type Output = [T]
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &Self::Output[src]
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]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Vector<T>[src]
impl<T: Clone + Serialize> Serialize for Vector<T>[src]
impl<'de, T: Clone + Deserialize<'de>> Deserialize<'de> for Vector<T>[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
Auto Trait Implementations
impl<T> Send for Vector<T> where
T: Send,
T: Send,
impl<T> Unpin for Vector<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Vector<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for Vector<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Vector<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> HeapSpace for T where
T: Copy, [src]
T: Copy,
fn heap_space(&Self) -> usize[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> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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> 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,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,