Crates.io | shared-iter |
lib.rs | shared-iter |
version | 0.2.0 |
source | src |
created_at | 2019-10-02 14:59:03.086403 |
updated_at | 2020-05-19 08:45:06.252707 |
description | Sharing |
homepage | |
repository | https://github.com/lperlaki/shared-iter-rs |
max_upload_size | |
id | 169393 |
size | 5,266 |
Clone an Iterator and shared it accros threads
use shared_iter::ShareIterator;
let iter1 = (1..20).share();
let iter2 = iter1.clone();
assert_eq!(iter1.take(10).collect::<Vec<_>>(), iter2.take(10).collect::<Vec<_>>());