lazy_transducer

Crates.iolazy_transducer
lib.rslazy_transducer
version0.2.1
sourcesrc
created_at2018-01-01 00:50:21.649112
updated_at2020-02-26 04:11:43.846887
descriptionLazy, parallel, indexable, generic data iterators
homepage
repositoryhttps://github.com/m4b/lazy_transducer
max_upload_size
id45075
size39,874
(m4b)

documentation

https://docs.rs/lazy_transducer

README

Lazy Transducer Build Status

Lazy transducers are generic, lazy, parallel, indexable iterators transforming one data source into n output data types.

See the online documentation for more information.

Using

Add this to your Cargo.toml

[dependencies]
lazy_transducer = "0.1"

Example

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);
  });
}
Commit count: 9

cargo fmt