[−][src]Struct stack_dst::StackA
A fixed-capacity stack that can contain dynamically-sized types
Uses an array of usize as a backing store for a First-In, Last-Out stack
of items that can unsize to T
.
Note: Each item in the stack takes at least one usize
(to store the metadata)
Methods
impl<T: ?Sized, D: DataBuf> StackA<T, D>
[src]
pub fn new() -> StackA<T, D>
[src]
Construct a new (empty) stack
pub fn is_empty(&self) -> bool
[src]
Tests if the stack is empty
pub fn push<U: Unsize<T>>(&mut self, v: U) -> Result<(), U>
[src]
Push a value at the top of the stack
pub fn top(&self) -> Option<&T>
[src]
Returns a pointer to the top item on the stack
pub fn top_mut(&mut self) -> Option<&mut T>
[src]
Returns a pointer to the top item on the stack (unique/mutable)
pub fn pop(&mut self)
[src]
Pop the top item off the stack
impl<D: DataBuf> StackA<str, D>
[src]
pub fn push_str(&mut self, v: &str) -> Result<(), ()>
[src]
Push the contents of a string slice as an item onto the stack
impl<D: DataBuf, T: Clone> StackA<[T], D>
[src]
pub fn push_cloned(&mut self, v: &[T]) -> Result<(), ()>
[src]
Pushes a set of items (cloning out of the input slice)
Trait Implementations
impl<T: ?Sized, D: DataBuf> Drop for StackA<T, D>
[src]
impl<T: ?Sized, D: DataBuf> Default for StackA<T, D>
[src]
Auto Trait Implementations
impl<T, D> !Send for StackA<T, D>
impl<T, D> !Sync for StackA<T, D>
impl<T: ?Sized, D> Unpin for StackA<T, D> where
D: Unpin,
D: Unpin,
impl<T: ?Sized, D> UnwindSafe for StackA<T, D> where
D: UnwindSafe,
T: RefUnwindSafe,
D: UnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized, D> RefUnwindSafe for StackA<T, D> where
D: RefUnwindSafe,
T: RefUnwindSafe,
D: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
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 = !
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,