[−][src]Struct coco::deque::Stealer
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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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,
T: RefUnwindSafe,
impl<T> RefUnwindSafe for Stealer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,