pub struct FutureObj<'a, T>(_);
A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + Send + 'a>
.
This custom trait object was introduced for two reasons:
- Currently it is not possible to take
dyn Trait
by value and
Box<dyn Trait>
is not available in no_std contexts.
- The
Future
trait is currently not object safe: The Future::poll
method makes uses the arbitrary self types feature and traits in which
this feature is used are currently not object safe due to current compiler
limitations. (See tracking issue for arbitrary self types for more
information #44874)
Create a FutureObj
from a custom trait object representation.
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
The result of the Future
.
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
type Ok = T
The type of successful values yielded by this future
The type of failures yielded by this future
Poll this TryFuture
as if it were a Future
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)