This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env run-cargo-script | |
//! ```cargo | |
//! [dependencies] | |
//! tokio = "=0.1.7" | |
//! tokio-codec = "*" | |
//! tokio-io = "=0.1.7" | |
//! futures-cpupool = "*" | |
//! mio = "*" | |
//! | |
//! [replace] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! An adapter for merging the output of two streams, where | |
//! the stream resolves as soon either stream resolves. | |
use futures::{Poll, Async}; | |
use futures::stream::{Stream, Fuse}; | |
pub struct AndSelect<S1, S2> { | |
stream1: Fuse<S1>, | |
stream2: Fuse<S2>, | |
flag: bool, |