[][src]Struct stack_vec::StackVec4096

pub struct StackVec4096<T>(_, _);

A sized stack vector

Implementations

impl<T> StackVec4096<T>[src]

pub const CAPACITY: usize[src]

The max capacity of this StackVec type

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

The max capacity of this StackVec

Note

Identical to Self::CAPACITY, however more convenient for ad-hoc types created through stack![n].

pub fn new() -> Self[src]

Create a new empty StackVec.

pub fn extend_from_slice_copy<U: AsRef<[T]>>(&mut self, slice: U) -> usize where
    T: Copy
[src]

Extend from a slice where T: Copy.

Returns the number of elements copied. If the copy would overflow the capacity the rest is ignored.

pub fn extend_from_slice<U: AsRef<[T]>>(&mut self, slice: U) -> usize where
    T: Clone
[src]

Extend from a slice where T: Clone

Returns the number of elements copied. If the copy would overflow the capacity the rest is ignored.

pub fn try_push(&mut self, value: T) -> Result<(), T>[src]

Try to push an element on to the end of the StackVec.

If it is full, return the value as Err(T) instead.

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

Push an element on the the end of the StackVec.

Panics

If the StackVec is full.

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

The number of elements currently in the StackVec.

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

A slice of the elements in the StackVec.

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

A mutable slice of the elements in the StackVec.

pub fn init_buffer_mut(&mut self) -> &mut [MaybeUninit<T>][src]

A mutable slice of the initialised part of the buffer.

All elements of the returned slice are initialised.

pub fn init_buffer(&self) -> &[MaybeUninit<T>][src]

The initialised part of the buffer.

All elements of the returned slice are initialised.

pub unsafe fn rest_mut(&mut self) -> &mut [MaybeUninit<T>][src]

A mutable reference to the uninitialised part of the instance.

No elements of the returned slice are initialised.

Note

If you initialise some, you must remember to update the length with set_len().

pub fn rest(&self) -> &[MaybeUninit<T>][src]

The uninitialised part of the instance.

No elements of the returned slice are initialised.

pub unsafe fn buffer_mut(&mut self) -> &mut [MaybeUninit<T>; 4096][src]

A mutable reference to the whole capacity buffer.

..self.len() will be initialised, self.len().. will be uninitialised.

Note

If you initialise or uninitialise some element(s), you must remember to update the length with set_len().

pub fn buffer(&self) -> &[MaybeUninit<T>; 4096][src]

A reference to the whole capacity buffer.

..self.len() will be initialised, self.len().. will be uninitialised.

pub unsafe fn set_len(&mut self, len: usize)[src]

Set the internal fill pointer of the StackVec.

This changes how much of the buffer is assumed to be initialised. Only use this if you have manually initialised some of the uninitialised buffer, as it does no initialising itself.

Trait Implementations

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

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

impl<T> Borrow<[T]> for StackVec4096<T>[src]

impl<T> BorrowMut<[T]> for StackVec4096<T>[src]

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

impl<T> Debug for StackVec4096<T> where
    T: Debug
[src]

impl<T> Default for StackVec4096<T>[src]

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

type Target = [T]

The resulting type after dereferencing.

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

impl<T> Drop for StackVec4096<T>[src]

impl<T> Eq for StackVec4096<T> where
    T: Eq
[src]

impl<T> From<[T; 4096]> for StackVec4096<T>[src]

impl<T> From<StackVec4096<T>> for Vec<T>[src]

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

impl<T, I: SliceIndex<[T]>> Index<I> for StackVec4096<T>[src]

type Output = I::Output

The returned type after indexing.

impl<T, I: SliceIndex<[T]>> IndexMut<I> for StackVec4096<T>[src]

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

type Item = T

The type of the elements being iterated over.

type IntoIter = StackVec4096IntoIter<T>

Which kind of iterator are we turning this into?

impl<T> Ord for StackVec4096<T> where
    T: Ord
[src]

impl<T, U> PartialEq<U> for StackVec4096<T> where
    T: PartialEq,
    U: AsRef<[T]>, 
[src]

impl<T, U> PartialOrd<U> for StackVec4096<T> where
    T: PartialOrd,
    U: AsRef<[T]>, 
[src]

impl Write for StackVec4096<u8>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.