Crates.io | lazy_transducer |
lib.rs | lazy_transducer |
version | 0.2.1 |
source | src |
created_at | 2018-01-01 00:50:21.649112 |
updated_at | 2020-02-26 04:11:43.846887 |
description | Lazy, parallel, indexable, generic data iterators |
homepage | |
repository | https://github.com/m4b/lazy_transducer |
max_upload_size | |
id | 45075 |
size | 39,874 |
Lazy transducers are generic, lazy, parallel, indexable iterators transforming one data source into n
output data types.
See the online documentation for more information.
Add this to your Cargo.toml
[dependencies]
lazy_transducer = "0.1"
extern crate lazy_transducer;
extern crate rayon;
use rayon::prelude::*;
use lazy_transducer::LazyTransducer;
fn main() {
let data = [0xdeadbeefu32, 0xcafed00d];
let lt: LazyTransducer<&[u32], u64> = LazyTransducer::new(&data, 2, |input, idx| input[idx] as u64);
let cafedood = lt.get(1).expect("has 2 elements");
assert_eq!(cafedood, 0xcafed00d);
lt.into_par_iter().for_each(|elem| {
println!("{}", elem);
});
}