pub fn push(&self, value: T) {
        // Load the back index, front index, and buffer.
        let b = self.inner.back.load(Ordering::Relaxed);
        let f = self.inner.front.load(Ordering::Acquire);
        let mut buffer = self.cached_buffer.get();

        // Calculate the length of the deque.
        let len = b.wrapping_sub(f);

        // Is the deque full?
        if len >= buffer.cap as isize {
            // Yes. Grow the underlying buffer.
            unsafe {
                self.resize(2 * buffer.cap);
            }
            buffer = self.cached_buffer.get();
        }

        // Write `value` into the slot.
        unsafe {
            buffer.write(b, value);
        }

        atomic::fence(Ordering::Release);

        // Increment the back index.
        //
        // This ordering could be `Relaxed`, but then thread sanitizer would falsely report data
        // races because it doesn't understand fences.
        self.inner.back.store(b.wrapping_add(1), Ordering::Release);
    }
/// Pushes an element into the back of the deque.
///
/// # Examples
///
/// ```
/// use crossbeam_deque as deque;
///
/// let (w, _) = deque::lifo();
/// w.push(1);
/// w.push(2);
/// ```
Pushes an element into the back of the deque.
Pushes an element into the back of the deque .
pub fn push(&self, value: T) {
        // Load the back index, front index, and buffer.
        let b = self.inner.back.load(Ordering::Relaxed);
        let f = self.inner.front.load(Ordering::Acquire);
        let mut buffer = self.cached_buffer.get();
        // Calculate the length of the deque.
        let len = b.wrapping_sub(f);
        // Is the deque full?
        if len >= buffer.cap as isize {
            // Yes. Grow the underlying buffer.
            unsafe {
                self.resize(2 * buffer.cap);
            }
            buffer = self.cached_buffer.get();
        }
        // Write `value` into the slot.
        unsafe {
            buffer.write(b, value);
        }
        atomic::fence(Ordering::Release);
        // Increment the back index.
        //
        // This ordering could be `Relaxed`, but then thread sanitizer would falsely report data
        // races because it doesn't understand fences.
        self.inner.back.store(b.wrapping_add(1), Ordering::Release);
    }
pub fn push ( & self , value : T ) { // Load the back index, front index, and buffer. let b = self . inner . back . load ( Ordering :: Relaxed ) ; let f = self . inner . front . load ( Ordering :: Acquire ) ; let mut buffer = self . cached_buffer . get ( ) ; // Calculate the length of the deque. let len = b . wrapping_sub ( f ) ; // Is the deque full? if len >= buffer . cap as isize { // Yes. Grow the underlying buffer. unsafe { self . resize ( 2 * buffer . cap ) ; } buffer = self . cached_buffer . get ( ) ; } // Write `value` into the slot. unsafe { buffer . write ( b , value ) ; } atomic :: fence ( Ordering :: Release ) ; // Increment the back index. // // This ordering could be `Relaxed`, but then thread sanitizer would falsely report data // races because it doesn't understand fences. self . inner . back . store ( b . wrapping_add ( 1 ) , Ordering :: Release ) ; }
Pushes an element into the back of the deque.
Pushes an element into the back of the deque .
&self
value
T
&self
value
T
examples
```
use crossbeam_deque as deque.


` ` ` use crossbeam_deque as deque .