pub struct WorkerQueue { /* private fields */ }Expand description
Per-worker task queue supporting work-stealing
Implementations§
Source§impl WorkerQueue
impl WorkerQueue
Sourcepub fn push(&self, task: WorkStealingTask)
pub fn push(&self, task: WorkStealingTask)
Push a task to the local queue
Sourcepub fn pop(&self) -> Option<WorkStealingTask>
pub fn pop(&self) -> Option<WorkStealingTask>
Pop a task from the local queue (highest priority first)
Sourcepub fn steal(&self) -> Option<WorkStealingTask>
pub fn steal(&self) -> Option<WorkStealingTask>
Steal a task from this queue (lowest priority - be nice to owner)
Sourcepub fn mark_completed(&self)
pub fn mark_completed(&self)
Mark a task as completed
Sourcepub fn completed_count(&self) -> u64
pub fn completed_count(&self) -> u64
Get completed count
Sourcepub fn stolen_count(&self) -> u64
pub fn stolen_count(&self) -> u64
Get stolen count
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WorkerQueue
impl RefUnwindSafe for WorkerQueue
impl Send for WorkerQueue
impl Sync for WorkerQueue
impl Unpin for WorkerQueue
impl UnsafeUnpin for WorkerQueue
impl UnwindSafe for WorkerQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more