[][src]Enum sunrise_libuser::futures::WorkItem

enum WorkItem<'a> {
    Poll(Index),
    Spawn(FutureObj<'a, ()>),
    WaitHandle(HandleRef<'static>, Waker, Index),
    UnregisterHandle(HandleRef<'static>, Waker),
}

A WorkItem is an element of work that will be executed by a WaitableManager's run function. By pushing a new WorkItem on a WorkQueue, the user can drive the event loop.

The user can only access two of the three possible WorkItems: Spawn and WaitHandle. Poll is used internally when an awaited handle is signaled.

Variants

Poll(Index)

Causes the Task specified by the index to be woken up and polled.

Spawn(FutureObj<'a, ()>)

Creates a new Task backed by the given future on the event loop.

WaitHandle(HandleRef<'static>, Waker, Index)

Registers the Task backed by the given Waker to be woken up when the passed handle is signaled - which is detected by adding it to the list of handles the event loop calls syscalls::wait_synchronization() on when no other task needs to run.

UnregisterHandle(HandleRef<'static>, Waker)

Stop the task identified by the Waker from waiting on this handle. We use the waker's will_wake function to identify the proper task.

Trait Implementations

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

Auto Trait Implementations

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

impl<'a> Send for WorkItem<'a>

impl<'a> !Sync for WorkItem<'a>

impl<'a> Unpin for WorkItem<'a>

impl<'a> !UnwindSafe for WorkItem<'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, 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.