[][src]Struct sunrise_libuser::futures::WorkQueue

pub struct WorkQueue<'a>(Arc<Mutex<VecDeque<WorkItem<'a>>>>);

A WorkQueue represents a handle to a WaitableManager on which you can spawn new Futures with WorkQueue::spawn() or put the current future to sleep until a handle is signaled through HandleRef::wait_async().

This handle may be cloned - it will still point to the same WaitableManager. It may be shared with other threads, sent to other event loops, etc... in order to implement message passing.

Internally, a WorkQueue is an (Arc'd) deque of WorkItem, which the event loop will pop from in order to drive the scheduler.

Implementations

impl<'a> WorkQueue<'a>[src]

pub fn spawn(&self, future: FutureObj<'a, ()>)[src]

Spawn a top-level future on the event loop. The future will be polled once on spawn. Once the future is spawned, it will be owned by the WaitableManager.

pub(crate) fn simple(self) -> SimpleWorkQueue[src]

Turn this WorkQueue into a SimpleWorkQueue.

Trait Implementations

impl<'a> Clone for WorkQueue<'a>[src]

impl<'a> Debug for WorkQueue<'a>[src]

impl<'a> Default for WorkQueue<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for WorkQueue<'a>

impl<'a> Send for WorkQueue<'a>

impl<'a> Sync for WorkQueue<'a>

impl<'a> Unpin for WorkQueue<'a>

impl<'a> !UnwindSafe for WorkQueue<'a>

Blanket Implementations

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

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

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

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

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

impl<T> SizedIPCBuffer 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.