[−][src]Struct rate_common::memory::BoundedVector
A contiguous but non-growable array type, using Vector
This exposes a subset of the Vector API (and thus essentially behaves
like a std::vec::Vec). Notably, it does not provide functions that grow the
capacity of the vector.
A BoundedVector can be used as a stack with a known maximum size.
Methods
impl<T: HeapSpace> BoundedVector<T>[src]
pub fn with_capacity(capacity: usize) -> BoundedVector<T>[src]
See Vec::with_capacity().
pub fn push(&mut self, value: T)[src]
Pushes a value, increasing the vector's length by one.
Note that unlike [Vec::push()`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.push)
this does not grow the vector if it is full.
Panics
Panics if there is no space for the new element.
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(&mut 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().
impl<T: HeapSpace + Clone + Default> BoundedVector<T>[src]
pub fn resize(&mut self, new_length: usize)[src]
See Vec::resize().
impl<T: HeapSpace + Ord> BoundedVector<T>[src]
pub fn sort_unstable(&mut self)[src]
See Vec::sort_unstable().
impl<T: HeapSpace> BoundedVector<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,
Trait Implementations
impl<T> HeapSpace for BoundedVector<T> where
T: HeapSpace, [src]
T: HeapSpace,
fn heap_space(&self) -> usize[src]
impl<T: Default> Default for BoundedVector<T> where
T: HeapSpace, [src]
T: HeapSpace,
fn default() -> BoundedVector<T>[src]
impl<T: Clone> Clone for BoundedVector<T> where
T: HeapSpace, [src]
T: HeapSpace,
fn clone(&self) -> BoundedVector<T>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<T: PartialEq> PartialEq<BoundedVector<T>> for BoundedVector<T> where
T: HeapSpace, [src]
T: HeapSpace,
fn eq(&self, other: &BoundedVector<T>) -> bool[src]
fn ne(&self, other: &BoundedVector<T>) -> bool[src]
impl<'a, T: HeapSpace> IntoIterator for &'a BoundedVector<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: HeapSpace> Index<usize> for BoundedVector<T>[src]
impl<T: HeapSpace> IndexMut<usize> for BoundedVector<T>[src]
impl<T: Debug> Debug for BoundedVector<T> where
T: HeapSpace, [src]
T: HeapSpace,
Auto Trait Implementations
impl<T> Send for BoundedVector<T> where
T: Send,
T: Send,
impl<T> Unpin for BoundedVector<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for BoundedVector<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for BoundedVector<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for BoundedVector<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<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,