Crate peeknth

Crate peeknth 

Source
Expand description

§peeknth

An iterator adapter for peeking multiple elements ahead or behind.

This crate provides flexible, composable tools for lookahead and lookbehind peeking, supporting both heap-allocated and zero-allocation use cases.

§Available Modules (feature-dependent)

  • peekn — Forward peeking multiple steps (PeekN, SizedPeekN)
  • peekdn — Double-ended peeking from both front/back (PeekDn, SizedPeekDn)
  • peekde — Lightweight double-ended peek (1 element each, via PeekableDE)

§no_std Support

This crate is fully #![no_std] compatible.

  • PeekN, PeekDn, PeekableDE require the alloc crate
  • SizedPeekN, SizedPeekDn require no allocation at all

Structs§

PeekDN
PeekDN is an iterator adapter that enables double-ended peeking.
PeekN
PeekN is an iterator adapter that allows peeking at any future element in the iterator, not just the next one.
PeekableDE
PeekableDE is an iterator adapter that allows peeking both forward and backward in a DoubleEndedIterator, similar to Peekable but bidirectional.
SizedPeekDN
A double-ended peekable iterator with fixed-size front and back buffers.
SizedPeekN
A peekable iterator with a fixed-size front buffer.

Functions§

peekablede
A convenient function to wrap an iterator into PeekN.
peekdn
A Convenient function to wrap an iterator into PeekDN.
peekn
A convenient function to wrap an iterator into PeekN.
sizedpeekdn
Creates a new SizedPeekDN from a given iterator with statically defined buffer sizes.
sizedpeekn
Creates a new SizedPeekN<I, S> from the given iterator.