pub fn drain_stack_top(
        &mut self,
        count: usize,
    ) -> Result<impl DoubleEndedIterator<Item = Value> + '_, StackError> {
        match self.stack.len().checked_sub(count) {
            Some(start) if start >= self.stack_bottom => Ok(self.stack.drain(start..)),
            _ => Err(StackError(())),
        }
    }
/// Drain the top `count` elements of the stack in the order that they were
/// pushed, from bottom to top.
Drain the top `count` elements of the stack in the order that they were
pushed, from bottom to top.
Drain the top ` count ` elements of the stack in the order that they were pushed from bottom to top .
pub fn drain_stack_top(
        &mut self,
        count: usize,
    ) -> Result<impl DoubleEndedIterator<Item = Value> + '_, StackError> {
        match self.stack.len().checked_sub(count) {
            Some(start) if start >= self.stack_bottom => Ok(self.stack.drain(start..)),
            _ => Err(StackError(())),
        }
    }
pub fn drain_stack_top ( & mut self , count : usize , ) -> Result < impl DoubleEndedIterator < Item = Value > + ' _ , StackError > { match self . stack . len ( ) . checked_sub ( count ) { Some ( start ) if start >= self . stack_bottom => Ok ( self . stack . drain ( start .. ) ) , _ => Err ( StackError ( ( ) ) ) , } }
Drain the top `count` elements of the stack in the order that they were
pushed, from bottom to top.
Drain the top ` count ` elements of the stack in the order that they were pushed from bottom to top .
&mut self
count
usize
&mut self
count
usize