https://github.com/m4b/lazy_transducer
Lazy, parallel, indexable, generic data iterators
https://github.com/m4b/lazy_transducer
Last synced: 8 months ago
JSON representation
Lazy, parallel, indexable, generic data iterators
- Host: GitHub
- URL: https://github.com/m4b/lazy_transducer
- Owner: m4b
- License: mit
- Created: 2018-01-01T00:10:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-01T01:51:16.000Z (over 8 years ago)
- Last Synced: 2025-09-24T05:18:35.742Z (9 months ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lazy Transducer [](https://travis-ci.org/m4b/lazy_transducer)
Lazy transducers are generic, lazy, parallel, indexable iterators transforming one data source into `n` output data types.
See the online [documentation](https://docs.rs/lazy_transducer) for more information.
## Using
Add this to your `Cargo.toml`
```toml
[dependencies]
lazy_transducer = "0.1"
```
## Example
```rust
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);
});
}
```