pub fn push(&mut self, data: Data) -> Result<(), StackErr> {
        if self.data.len() < self.capacity {
            self.data.push(data);

            Ok(())
        } else {
            Err(StackErr::Overflow)
        }
    }
/// Pushes a new item onto the stack.
Pushes a new item onto the stack.
Pushes a new item onto the stack .
pub fn push(&mut self, data: Data) -> Result<(), StackErr> {
        if self.data.len() < self.capacity {
            self.data.push(data);
            Ok(())
        } else {
            Err(StackErr::Overflow)
        }
    }
pub fn push ( & mut self , data : Data ) -> Result < ( ) , StackErr > { if self . data . len ( ) < self . capacity { self . data . push ( data ) ; Ok ( ( ) ) } else { Err ( StackErr :: Overflow ) } }
Pushes a new item onto the stack.
Pushes a new item onto the stack .
&mut self
data
Data
&mut self
data
Data