Crates.io | transiter |
lib.rs | transiter |
version | 0.2.0 |
source | src |
created_at | 2021-06-20 08:14:29.162338 |
updated_at | 2021-10-31 19:19:45.210764 |
description | An Iterator suitable for navigating recursive structures and DAGs |
homepage | |
repository | |
max_upload_size | |
id | 412347 |
size | 31,680 |
This small rust crate provides TransIter
, an iterator suitable for navigating
recursive structures and DAGs. The iterator allows for multiple modes of
iteration. For structures in which the nodes implement Ord
, this crate also
provides a TransPrioQueue
.
In addition to the iterators themselves, this crate provides some convenience traits for creating instances of those iterators.
use transiter::IntoTransIter;
let names: Vec<_> = String::new()
.trans_iter_with(|s| { let s = s.clone(); ["a", "b", "c"].iter().map(move |c| s.clone() + c)})
.take(10)
.collect();
assert_eq!(names, vec!["", "a", "b", "c", "aa", "ab", "ac", "ba", "bb", "bc"]);
The following crates serve a similar purpose:
This work is provided under the MIT license. See LICENSE
for more details.