Ready in core::future - Rust (original) (raw)

Struct Ready

1.48.0 · Source

pub struct Ready<T>(/* private fields */);

Expand description

A future that is immediately ready with a value.

This struct is created by ready(). See its documentation for more.

Source§

1.82.0 · Source

Consumes the Ready, returning the wrapped value.

§Panics

Will panic if this Ready was already polled to completion.

§Examples
use std::future;

let a = future::ready(1);
assert_eq!(a.into_inner(), 1);

1.48.0 · Source§

1.48.0 · Source§

1.48.0 · Source§

Source§

The type of value produced on completion.

Source§

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

1.48.0 · Source§