Struct Memchr2
pub struct Memchr2<'h> { /* private fields */ }
An iterator over all occurrences of two possible bytes in a haystack.
This iterator implements DoubleEndedIterator, which means it can also be
used to find occurrences in reverse order.
This iterator is created by the memchr2_iter or [memrchr2_iter]
functions. It can also be created with the Memchr2::new method.
The lifetime parameter 'h refers to the lifetime of the haystack being
searched.
Implementations
impl<'h> Memchr2<'h>
fn new(needle1: u8, needle2: u8, haystack: &'h [u8]) -> Memchr2<'h>Returns an iterator over all occurrences of the needle bytes in the given haystack.
The iterator returned implements
DoubleEndedIterator. This means it can also be used to find occurrences in reverse order.
Trait Implementations
impl<'h> Clone for Memchr2<'h>
fn clone(&self) -> Self
impl<'h> Debug for Memchr2<'h>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<'h> DoubleEndedIterator for Memchr2<'h>
fn next_back(&mut self) -> Option<usize>
impl<'h> FusedIterator for Memchr2<'h>
impl<'h> Iterator for Memchr2<'h>
type Item = usize;fn next(&mut self) -> Option<usize>fn size_hint(&self) -> (usize, Option<usize>)