Trait packed_streaming_iterator::Stack
source · pub trait Stack {
type Item;
// Required methods
fn try_push(&mut self, elem: Self::Item) -> bool;
fn pop(&mut self) -> Option<Self::Item>;
fn get(&self) -> Option<&Self::Item>;
fn get_mut(&mut self) -> Option<&mut Self::Item>;
fn is_empty(&self) -> bool;
}
Expand description
A trait defining a Stack datastructure.
Any such datastructure can be used to store the iterators for Streaming::inner_combinations
. Is implemented for Vec
Required Associated Types§
Required Methods§
sourcefn try_push(&mut self, elem: Self::Item) -> bool
fn try_push(&mut self, elem: Self::Item) -> bool
try to push to the stack, indicate success. This may fail, e.g. for a limited buffer.
sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
indicate if the stack is empty.
Stack::pop
, Stack::get
and Stack::get_mut
should return None
exactly if this returns true
.