Provides functionality for pausing, stopping, and resuming iterators, readers, and writers.
Add this to Cargo.toml
:
toml
[dependencies]
halt = "0.5"
And this to main.rs
:
```rust use std::{io, thread};
fn main() { let mut halt = halt::new(io::repeat(0)); let remote = halt.remote(); // Copy into a sink, in a separate thread. thread::spawn(move || io::copy(&mut halt, &mut io::sink()).unwrap()); // The remote can now be used to pause, stop, and resume the reader from the main thread. remote.pause(); remote.resume(); } ```
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.