#iterator #peek #next #no-alloc #no-std

no-std multi_iter

Iterator for acting on multiple elements at a time

7 releases

0.1.6 Mar 18, 2023
0.1.5 Mar 18, 2023

#1900 in Algorithms

Download history 1/week @ 2024-07-22 9/week @ 2024-09-23

75 downloads per month

MIT license

19KB
287 lines

CI crates.io

multi_iter

Iterator for acting on multiple elements at a time.

Features

  1. Peek multiple elements with:

    • peek_n
    • peek_rest
  2. Advance in windows by using:

    • next_n
    • next_n_if_each
    • next_n_if_slice
  3. Collect with zero allocations using:

    • remaining
    • remaining_if
    • remaining_if_slice

Installation

[dependencies]
multi_iter = "0.1.6"

No-std support

It is possible to use this crate without the Rust standard library. Disable the default "std" feature by doing the following:

[dependencies]
multi_iter = { version = "0.1.6", default-features = false }

lib.rs:

This crate provides an iterator which can act on multiple elements at once without any allocations. Its functions are similar to std::iter::Iterator.

No runtime deps

Features