Struct heapless::Vec
[−]
[src]
pub struct Vec<T, A> where
A: Unsize<[T]>, { /* fields omitted */ }
A Vec
, vector, backed by a fixed size array
Methods
impl<T, A> Vec<T, A> where
A: Unsize<[T]>,
[src]
A: Unsize<[T]>,
const fn new() -> Self
[src]
Constructs a new, empty Vec<T>
backed by the array A
fn capacity(&self) -> usize
[src]
Returns the maximum number of elements the vector can hold
fn clear(&mut self)
[src]
Clears the vector, removing all values.
fn pop(&mut self) -> Option<T>
[src]
Removes the last element from a vector and return it, or None
if it's empty
fn push(&mut self, item: T) -> Result<(), BufferFullError>
[src]
Appends an element to the back of the collection
Returns BufferFullError
if the vector is full
fn truncate(&mut self, len: usize)
[src]
Shortens the vector, keeping the first len
elements and dropping the rest.
Trait Implementations
impl<T, A> Drop for Vec<T, A> where
A: Unsize<[T]>,
[src]
A: Unsize<[T]>,
impl<'a, T, A> IntoIterator for &'a Vec<T, A> where
A: Unsize<[T]>,
[src]
A: Unsize<[T]>,
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]
Creates an iterator from a value. Read more
impl<'a, T, A> IntoIterator for &'a mut Vec<T, A> where
A: Unsize<[T]>,
[src]
A: Unsize<[T]>,
type Item = &'a mut T
The type of the elements being iterated over.
type IntoIter = IterMut<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more
impl<T, A> Deref for Vec<T, A> where
A: Unsize<[T]>,
[src]
A: Unsize<[T]>,
type Target = [T]
The resulting type after dereferencing.
fn deref(&self) -> &[T]
[src]
Dereferences the value.
impl<T, A> DerefMut for Vec<T, A> where
A: Unsize<[T]>,
[src]
A: Unsize<[T]>,