Struct Context

struct Context<'a> { ... }

The context of an asynchronous task.

Currently, Context only serves to provide access to a &Waker which can be used to wake the current task.

Implementations

impl<'a> Context<'a>

const fn from_waker(waker: &'a Waker) -> Self

Creates a new Context from a &Waker.

const fn waker(self: &Self) -> &'a Waker

Returns a reference to the Waker for the current task.

const fn local_waker(self: &Self) -> &'a LocalWaker

Returns a reference to the LocalWaker for the current task.

const fn ext(self: &mut Self) -> &mut dyn Any

Returns a reference to the extension data for the current task.

impl Debug for Context<'_>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<'a> Freeze for Context<'a>

impl<'a> RefUnwindSafe for Context<'a>

impl<'a> Send for Context<'a>

impl<'a> Sync for Context<'a>

impl<'a> Unpin for Context<'a>

impl<'a> UnsafeUnpin for Context<'a>

impl<'a> UnwindSafe for Context<'a>

impl<T> Any for Context<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Context<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Context<'a>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Context<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Context<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Context<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Context<'a>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>