pub trait DataDesta: DataStack {
// Required methods
fn stack_pop_front(
&mut self,
) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ⓘ;
fn stack_push_front(
&mut self,
element: <Self as DataCollection>::Element,
) -> Result<(), NotEnoughSpace> ⓘ;
// Provided methods
fn stack_pop_back(
&mut self,
) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ⓘ { ... }
fn stack_push_back(
&mut self,
element: <Self as DataCollection>::Element,
) -> Result<(), NotEnoughSpace> ⓘ { ... }
}
Expand description
An abstract double-ended stack data type.
Required Methods§
Sourcefn stack_pop_front(
&mut self,
) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ⓘ
fn stack_pop_front( &mut self, ) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ⓘ
Remove an element from the front of the stack.
Sourcefn stack_push_front(
&mut self,
element: <Self as DataCollection>::Element,
) -> Result<(), NotEnoughSpace> ⓘ
fn stack_push_front( &mut self, element: <Self as DataCollection>::Element, ) -> Result<(), NotEnoughSpace> ⓘ
Add an element to the front of the stack.
Provided Methods§
Sourcefn stack_pop_back(
&mut self,
) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ⓘ
fn stack_pop_back( &mut self, ) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ⓘ
Remove an element from the back of the stack (calls DataStack::stack_pop
).
Sourcefn stack_push_back(
&mut self,
element: <Self as DataCollection>::Element,
) -> Result<(), NotEnoughSpace> ⓘ
fn stack_push_back( &mut self, element: <Self as DataCollection>::Element, ) -> Result<(), NotEnoughSpace> ⓘ
Remove an element from the back of the stack (calls DataStack::stack_push
).