rok::core::future
rok::core::future - Future / Poll / Context / Waker /
IntoFuture (stdlib spec 2.20).
await e (inside an async body) polls e - or e.into_future() when
e has no poll - until Ready, suspending the coroutine with
Pending in between (refs-lang 4.12, rokc_hir::lower::coro).
Modules
Structs
Waker
pub struct WakerAsks the executor to poll a task again (2.20.2): a handle to the task
(rok::core::task), usable from any thread.
pub fn wake(self)Schedule the task again.
pub const fn clone(self) -> Waker
Context
pub struct ContextWhat a poll gets from the executor (2.20.2).
pub const fn from_waker(waker: Waker) -> Contextpub const fn waker(self) -> Waker
AsyncFuture
pub struct AsyncFuture<T>Trait implementations 3
unsafe impl<T: Send> Send for AsyncFuture<T>impl<T> Future for AsyncFuture<T>impl<T> Transfer for AsyncFuture<T>
TryAsyncFuture
pub struct TryAsyncFuture<TA throwing async body (async fn f() throws (E) -> T): the error
comes out of poll, so try await f() (refs-lang 4.14.10). Not a
Future (whose poll cannot throw); await and task::block_on_try
take it.
Enums
Poll
pub enum Poll<T>Ready(T)Pendingpub const fn is_ready(self) -> boolpub const fn is_pending(self) -> bool
Traits
Future
pub trait FutureAn asynchronous computation (2.20.1).
type Outputfn poll(ref self, ref ctx: Context) -> Poll<Output>
IntoFuture
pub trait IntoFutureWhat await accepts besides a Future (2.20.5).
type Outputtype IntoFuture: Future<Output = Output>fn into_future(self) -> IntoFuture