2 releases
Uses old Rust 2015
0.1.1 | Aug 21, 2017 |
---|---|
0.1.0 | Aug 18, 2017 |
#521 in #value
Used in ciruela
10KB
75 lines
Valuable-futures crate
Status: | Alpha |
---|---|
Documentation: | http://docs.rs/valuable-futures/ |
A library that allows writing futures having a by-value state (or type-safe futures inspired by #458). This is very useful for implemention futures as state machines or enums.
License
Licensed under either of
- Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
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.
Dependencies
~54KB