Crate valuable_futures [−] [src]
The crate provides by-value futures that make certain patterns easier and more typesafe
There are two by-value future traits:
Future
-- similar to normal future, but receives self by value. You must callinto_future()
to convert it tofutures::Future
StateMachine
-- similar toFuture
but also receives a mutable pointer ofSupply
type. Basically having both mutable state, and type-safe state machine. Converted tofutures::Future
by callingSupply::new
This crate also has it's own Async
type that contains a new state in
NotReady
option.
Structs
FutureWrapper |
A wrapper that converts type-safe future into normal future |
Supply |
A wrapper that provides mutable state to future-like |
Enums
Async |
A variant of |
Traits
Future |
A type-safe future trait |
StateMachine |
A type-safe future-like trait that has also borrowed mutable state |