#iterator #nightly #slippery #n-peekable #rewindable #abstinential #slippery-iterator

nightly slippery-iter

Easy to use abstinential (slippery), N-peekable and rewindable wrapper over an iterator. (Nightly Rust)

1 unstable release

0.1.2 Nov 15, 2024
0.1.1 Nov 15, 2024
0.1.0 Nov 15, 2024

#626 in Rust patterns

Download history 244/week @ 2024-11-10 80/week @ 2024-11-17 4/week @ 2024-11-24 18/week @ 2024-12-01 15/week @ 2024-12-08

181 downloads per month

MIT license

22KB
703 lines

Easy to use abstinential (slippery), N-peekable and rewindable wrapper over an iterator. (Nightly Rust)

Example:

use slippery_iter::{SlipperyIter, SlipperyIterator, IntoSlipperyIterator};

fn main() {
  let a = 0..=10;
  let mut b = SlipperyIter::from(a);
  println!("{:?}", b.peek_forward());
  println!("{:?}", b.peek_forward_many::<8>());
  println!("{:?}", b.consume_many::<6, 0>());
  println!("{:?}", b.peek_forward());
  println!("{:?}", b.peek_forward_many::<8>());
}

No runtime deps