[][src]Struct bastion_executor::run_queue::Worker

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

A worker queue.

This is a FIFO or LIFO queue that is owned by a single thread, but other threads may steal tasks from it. Task schedulers typically create a single worker queue per thread.

Methods

impl<T> Worker<T>[src]

pub fn new_fifo() -> Worker<T>[src]

Creates a FIFO worker queue.

pub fn new_lifo() -> Worker<T>[src]

Creates a LIFO worker queue.

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

Get the worker's run queue size

pub fn stealer(&self) -> Stealer<T>[src]

Creates a stealer for this queue.

The returned stealer can be shared among threads and cloned.

pub fn is_empty(&self) -> bool[src]

Returns true if the queue is empty.

pub fn push(&self, task: T)[src]

Pushes a task into the queue.

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

Pops a task from the queue.

Trait Implementations

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

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

Auto Trait Implementations

impl<T> !Sync for Worker<T>

impl<T> Unpin for Worker<T>

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

impl<T> !RefUnwindSafe for Worker<T>

Blanket Implementations

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

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

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]