Struct std::task::Context
pub struct Context<'a> { /* fields omitted */ }
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>
pub fn from_waker(waker: &'a Waker) -> Context<'a>
Create a new Context
from a &Waker
.
pub fn waker(&self) -> &'a Waker
Returns a reference to the Waker
for the current task.
Trait Implementations
impl<'_> Debug for Context<'_>
Auto Trait Implementations
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> UnwindSafe for Context<'a>
Blanket Implementations
impl<T> From<T> for T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
Performs the conversion.
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
Performs the conversion.
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
Performs the conversion.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/task/struct.Context.html