halt

Crates.iohalt
lib.rshalt
version2.0.2
sourcesrc
created_at2019-10-22 17:52:18.240251
updated_at2022-06-22 20:47:07.659874
descriptionProvides functionality for pausing, stopping, and resuming iterators, readers, and writers.
homepage
repositoryhttps://github.com/evenorog/halt
max_upload_size
id174719
size22,889
Even Rogstadkjærnet (evenorog)

documentation

https://docs.rs/halt

README

halt

Rust Crates.io Docs

Provides functionality for pausing, stopping, and resuming iterators, readers, and writers.

use std::{io, thread, time::Duration};

let mut halt = halt::new(io::repeat(0));
let remote = halt.remote();
thread::spawn(move || io::copy(&mut halt, &mut io::sink()).unwrap());

thread::sleep(Duration::from_secs(5));
remote.pause();
thread::sleep(Duration::from_secs(5));
remote.resume();
thread::sleep(Duration::from_secs(5));

License

Licensed under either of

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.

Commit count: 44

cargo fmt