bmatcher_core

Trait Stack

Source
pub trait Stack<T> {
    // Required methods
    fn new() -> Self;
    fn len(&self) -> usize;
    fn truncate(&mut self, size: usize);
    fn push_value(&mut self, value: T) -> bool;
    fn pop_value(&mut self) -> Option<T>;
    fn stack_mut(&mut self) -> &mut [T];

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn reserve(&mut self, _size: usize) { ... }
}

Required Methods§

Source

fn new() -> Self

Source

fn len(&self) -> usize

Source

fn truncate(&mut self, size: usize)

Source

fn push_value(&mut self, value: T) -> bool

Source

fn pop_value(&mut self) -> Option<T>

Source

fn stack_mut(&mut self) -> &mut [T]

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn reserve(&mut self, _size: usize)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Stack<T> for HeapStack<T>

Source§

impl<const N: usize, T: Default + Copy> Stack<T> for StaticStack<N, T>