Struct postage::Context[][src]

pub struct Context<'a> { /* fields omitted */ }

The Context of an asynchronous task.

Unlike std::task::Context, this context optionally contains a waker.

This is necessary because try_send and try_recv need to poll, but the task waker should not be saved if the try returns pending.

Implementations

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

pub fn from_waker(waker: &'a Waker) -> Self[src]

Create a new Context from a &Waker.

pub fn empty() -> Self[src]

Create an empty context with no waker.

pub fn waker(&self) -> Option<&'a Waker>[src]

Returns an optional reference to the Waker for the current task.

Trait Implementations

impl Debug for Context<'_>[src]

impl<'a> From<&'_ Context<'a>> for Context<'a>[src]

impl<'a> From<&'_ mut Context<'a>> for Context<'a>[src]

impl<'a> From<Context<'a>> for Context<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Context<'a>[src]

impl<'a> Send for Context<'a>[src]

impl<'a> Sync for Context<'a>[src]

impl<'a> Unpin for Context<'a>[src]

impl<'a> UnwindSafe for Context<'a>[src]

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, 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.