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, viaPeekableDE)
§no_std Support
This crate is fully #![no_std] compatible.
PeekN,PeekDn,PeekableDErequire thealloccrateSizedPeekN,SizedPeekDnrequire no allocation at all
Structs§
- PeekDN
PeekDNis an iterator adapter that enables double-ended peeking.- PeekN
PeekNis an iterator adapter that allows peeking at any future element in the iterator, not just the next one.- PeekableDE
PeekableDEis an iterator adapter that allows peeking both forward and backward in aDoubleEndedIterator, similar toPeekablebut bidirectional.- Sized
PeekDN - A double-ended peekable iterator with fixed-size front and back buffers.
- Sized
PeekN - 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
SizedPeekDNfrom a given iterator with statically defined buffer sizes. - sizedpeekn
- Creates a new
SizedPeekN<I, S>from the given iterator.