#[derive(Future, Stream, Sink, AsyncRead, AsyncWrite)] for enums.
Add this to your Cargo.toml
:
toml
[dependencies]
futures-enum = "0.1.1"
Now, you can use futures-enum:
rust
use futures_enum::*;
The current version of futures-enum requires Rust nightly 2019-01-11 or later.
```rust use futures::future::{self, Future}; use futures_enum::*;
enum Either { A(A), B(B), }
fn foo(x: i32) -> impl Future
See auto_enums for how to automate patterns like this.
See auto_enums#11 for other traits.
Licensed under either of
at your option.
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.