[−][src]Struct stack_vec::StackVec32
A sized stack vector
Implementations
impl<T> StackVec32<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]
T: Copy,
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]
T: Clone,
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]
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>; 32]
[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>; 32]
[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 StackVec32<T>
[src]
impl<T> AsRef<[T]> for StackVec32<T>
[src]
impl<T> Borrow<[T]> for StackVec32<T>
[src]
impl<T> BorrowMut<[T]> for StackVec32<T>
[src]
fn borrow_mut(&mut self) -> &mut [T]
[src]
impl<T> Clone for StackVec32<T> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for StackVec32<T> where
T: Debug,
[src]
T: Debug,
impl<T> Default for StackVec32<T>
[src]
impl<T> Deref for StackVec32<T>
[src]
impl<T> DerefMut for StackVec32<T>
[src]
impl<T> Drop for StackVec32<T>
[src]
impl<T> Eq for StackVec32<T> where
T: Eq,
[src]
T: Eq,
impl<T> From<[T; 32]> for StackVec32<T>
[src]
impl<T> From<StackVec32<T>> for Vec<T>
[src]
fn from(from: StackVec32<T>) -> Self
[src]
impl<T> FromIterator<T> for StackVec32<T>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl<T, I: SliceIndex<[T]>> Index<I> for StackVec32<T>
[src]
type Output = I::Output
The returned type after indexing.
fn index(&self, index: I) -> &Self::Output
[src]
impl<T, I: SliceIndex<[T]>> IndexMut<I> for StackVec32<T>
[src]
impl<T> IntoIterator for StackVec32<T>
[src]
type Item = T
The type of the elements being iterated over.
type IntoIter = StackVec32IntoIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T> Ord for StackVec32<T> where
T: Ord,
[src]
T: Ord,
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T, U> PartialEq<U> for StackVec32<T> where
T: PartialEq,
U: AsRef<[T]>,
[src]
T: PartialEq,
U: AsRef<[T]>,
impl<T, U> PartialOrd<U> for StackVec32<T> where
T: PartialOrd,
U: AsRef<[T]>,
[src]
T: PartialOrd,
U: AsRef<[T]>,
fn partial_cmp(&self, other: &U) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Write for StackVec32<u8>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn is_write_vectored(&self) -> bool
[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for StackVec32<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for StackVec32<T> where
T: Send,
T: Send,
impl<T> Sync for StackVec32<T> where
T: Sync,
T: Sync,
impl<T> Unpin for StackVec32<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for StackVec32<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for 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?
pub fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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>,