pub fn steal(&self) -> Steal<T> {
        // Load the front index.
        let f = self.inner.front.load(Ordering::Acquire);

        // A SeqCst fence is needed here.
        //
        // If the current thread is already pinned (reentrantly), we must manually issue the
        // fence. Otherwise, the following pinning will issue the fence anyway, so we don't
        // have to.
        if epoch::is_pinned() {
            atomic::fence(Ordering::SeqCst);
        }

        let guard = &epoch::pin();

        // Load the back index.
        let b = self.inner.back.load(Ordering::Acquire);

        // Is the deque empty?
        if b.wrapping_sub(f) <= 0 {
            return Steal::Empty;
        }

        // Load the buffer and read the value at the front.
        let buffer = self.inner.buffer.load(Ordering::Acquire, guard);
        let value = unsafe { buffer.deref().read(f) };

        // Try incrementing the front index to steal the value.
        if self.inner
            .front
            .compare_exchange(f, f.wrapping_add(1), Ordering::SeqCst, Ordering::Relaxed)
            .is_err()
        {
            // We didn't steal this value, forget it.
            mem::forget(value);
            return Steal::Retry;
        }

        // Return the stolen value.
        Steal::Data(value)
    }
/// Steals an element from the front of the deque.
///
/// # Examples
///
/// ```
/// use crossbeam_deque::{self as deque, Steal};
///
/// let (w, s) = deque::lifo();
/// w.push(1);
/// w.push(2);
///
/// assert_eq!(s.steal(), Steal::Data(1));
/// assert_eq!(s.steal(), Steal::Data(2));
/// assert_eq!(s.steal(), Steal::Empty);
/// ```
Steals an element from the front of the deque.
Steals an element from the front of the deque .
pub fn steal(&self) -> Steal<T> {
        // Load the front index.
        let f = self.inner.front.load(Ordering::Acquire);
        // A SeqCst fence is needed here.
        //
        // If the current thread is already pinned (reentrantly), we must manually issue the
        // fence. Otherwise, the following pinning will issue the fence anyway, so we don't
        // have to.
        if epoch::is_pinned() {
            atomic::fence(Ordering::SeqCst);
        }
        let guard = &epoch::pin();
        // Load the back index.
        let b = self.inner.back.load(Ordering::Acquire);
        // Is the deque empty?
        if b.wrapping_sub(f) <= 0 {
            return Steal::Empty;
        }
        // Load the buffer and read the value at the front.
        let buffer = self.inner.buffer.load(Ordering::Acquire, guard);
        let value = unsafe { buffer.deref().read(f) };
        // Try incrementing the front index to steal the value.
        if self.inner
            .front
            .compare_exchange(f, f.wrapping_add(1), Ordering::SeqCst, Ordering::Relaxed)
            .is_err()
        {
            // We didn't steal this value, forget it.
            mem::forget(value);
            return Steal::Retry;
        }
        // Return the stolen value.
        Steal::Data(value)
    }
pub fn steal ( & self ) -> Steal < T > { // Load the front index. let f = self . inner . front . load ( Ordering :: Acquire ) ; // A SeqCst fence is needed here. // // If the current thread is already pinned (reentrantly), we must manually issue the // fence. Otherwise, the following pinning will issue the fence anyway, so we don't // have to. if epoch :: is_pinned ( ) { atomic :: fence ( Ordering :: SeqCst ) ; } let guard = & epoch :: pin ( ) ; // Load the back index. let b = self . inner . back . load ( Ordering :: Acquire ) ; // Is the deque empty? if b . wrapping_sub ( f ) <= 0 { return Steal :: Empty ; } // Load the buffer and read the value at the front. let buffer = self . inner . buffer . load ( Ordering :: Acquire , guard ) ; let value = unsafe { buffer . deref ( ) . read ( f ) } ; // Try incrementing the front index to steal the value. if self . inner . front . compare_exchange ( f , f . wrapping_add ( 1 ) , Ordering :: SeqCst , Ordering :: Relaxed ) . is_err ( ) { // We didn't steal this value, forget it. mem :: forget ( value ) ; return Steal :: Retry ; } // Return the stolen value. Steal :: Data ( value ) }
Steals an element from the front of the deque.
Steals an element from the front of the deque .
&self
&self
examples
```
use crossbeam_deque::{self as deque, Steal}.




` ` ` use crossbeam_deque :: { self as deque Steal } .