/// Push something onto the buffer, unless the buffer is full.
Push something onto the buffer, unless the buffer is full.
Push something onto the buffer unless the buffer is full .
pub fn push_unless_full(&mut self, elem: T) -> Result<(), Error> {
        if self.is_full() {
            return Err(Error::BufferFull);
        }
        let index = (self.oldest + self.num_elems) % SIZE;
        self.data[index] = elem;
        self.num_elems += 1;
        Ok(())
    }
pub fn push_unless_full ( & mut self , elem : T ) -> Result < ( ) , Error > { if self . is_full ( ) { return Err ( Error :: BufferFull ) ; } let index = ( self . oldest + self . num_elems ) % SIZE ; self . data [ index ] = elem ; self . num_elems += 1 ; Ok ( ( ) ) }
Push something onto the buffer, unless the buffer is full.
Push something onto the buffer unless the buffer is full .
&mut self
elem
T