pub fn push(&mut self, val: T) -> Option<T> {
        let val = mem::replace(&mut self.vals[self.first()], Some(val));

        if self.is_full() {
            self.back += 1;
        }
        self.front += 1;

        val
    }
/// Insert a new element into the back of the queue. If the
/// queue is full, then it returns the element
/// that was removed.
///
/// # Example
/// When the queue is empty push returns none, but
/// when the queue is full push returns the element
/// that was bumped out.
/// ```
/// # extern crate bounded_queue;
/// # use bounded_queue::*;
/// # fn main() {
/// let mut queue = BoundedQueue::new(1);
///
/// assert!(queue.push(1) == None);
/// assert!(queue.push(2) == Some(1));
/// # }
/// ```
Insert a new element into the back of the queue. If the
queue is full, then it returns the element
that was removed.
Insert a new element into the back of the queue . If the queue is full then it returns the element that was removed .
pub fn push(&mut self, val: T) -> Option<T> {
        let val = mem::replace(&mut self.vals[self.first()], Some(val));
        if self.is_full() {
            self.back += 1;
        }
        self.front += 1;
        val
    }
pub fn push ( & mut self , val : T ) -> Option < T > { let val = mem :: replace ( & mut self . vals [ self . first ( ) ] , Some ( val ) ) ; if self . is_full ( ) { self . back += 1 ; } self . front += 1 ; val }
Insert a new element into the back of the queue.
Insert a new element into the back of the queue .
&mut self
val
T
&mut self
val
T
example
When the queue is empty push returns none, but
when the queue is full push returns the element
that was bumped out.
When the queue is empty push returns none but when the queue is full push returns the element that was bumped out .
extern crate bounded_queue;
None
use bounded_queue::*;
None
fn main() {
let mut queue = BoundedQueue::new(1).


let mut queue = BoundedQueue :: new ( 1 ) .
}
None