transiter 0.2.0

An Iterator suitable for navigating recursive structures and DAGs
Documentation
  • Coverage
  • 100%
    19 out of 19 items documented2 out of 17 items with examples
  • Size
  • Source code size: 31.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.67 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • neithernut

TransIter -- transitive iterator and utilities

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.

Example

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"]);

Similar crates

The following crates serve a similar purpose:

  • reciter provides a macro for creating an iterator from a recursive function.

License

This work is provided under the MIT license. See LICENSE for more details.