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
).