Struct UnsizedStack

Source
pub struct UnsizedStack<T: ?Sized> { /* private fields */ }

Implementations§

Source§

impl<T: ?Sized> UnsizedStack<T>

Source

pub const fn new() -> Self

Source

pub const fn bytes_occupied(&self) -> usize

Source

pub const fn buf_layout(&self) -> Layout

Source

pub const fn buf_ptr(&self) -> NonNull<u8>

Source

pub fn last(&self) -> Option<&T>

Source

pub fn last_mut(&mut self) -> Option<&mut T>

Source

pub fn get(&self, index: usize) -> Option<&T>

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>

Source

pub fn push<I>(&mut self, item: I, coercion: fn(&I) -> &T)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn pop(&mut self) -> Option<()>

Source

pub fn iter(&self) -> Iter<'_, T>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Source

pub fn clear(&mut self)

Trait Implementations§

Source§

impl<T: ?Sized + Debug> Debug for UnsizedStack<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ?Sized> Default for UnsizedStack<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: ?Sized> Index<usize> for UnsizedStack<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: ?Sized> IndexMut<usize> for UnsizedStack<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, T: ?Sized> IntoIterator for &'a UnsizedStack<T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T: ?Sized> IntoIterator for &'a mut UnsizedStack<T>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T> Freeze for UnsizedStack<T>
where T: ?Sized,

§

impl<T> RefUnwindSafe for UnsizedStack<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for UnsizedStack<T>
where T: Send + ?Sized,

§

impl<T> Sync for UnsizedStack<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for UnsizedStack<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for UnsizedStack<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.