[][src]Struct coco::deque::Stealer

pub struct Stealer<T> { /* fields omitted */ }

Stealer side of a work-stealing deque.

Stealers may be cloned in order to create more stealers for the same deque.

Methods

impl<T> Stealer<T>[src]

pub fn len(&self) -> usize[src]

Returns the number of elements in the deque.

If used concurrently with other operations, the returned number is just an estimate.

Examples

use coco::deque;

let (w, _) = deque::new();
for i in 0..30 {
    w.push(i);
}
assert_eq!(w.len(), 30);

pub fn steal(&self) -> Option<T>[src]

Steals an element from the top of the deque.

Examples

use coco::deque;

let (w, s) = deque::new();
w.push(1);
w.push(2);

assert_eq!(s.steal(), Some(1));
assert_eq!(s.steal(), Some(2));
assert_eq!(s.steal(), None);

Trait Implementations

impl<T: Send> Send for Stealer<T>[src]

impl<T: Send> Sync for Stealer<T>[src]

impl<T> Clone for Stealer<T>[src]

impl<T> Debug for Stealer<T>[src]

Auto Trait Implementations

impl<T> Unpin for Stealer<T>

impl<T> UnwindSafe for Stealer<T> where
    T: RefUnwindSafe

impl<T> RefUnwindSafe for Stealer<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]