Struct Memchr

pub struct Memchr<'h> { /* private fields */ }

An iterator over all occurrences of a single byte 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 memchr_iter or [memrchr_iter] functions. It can also be created with the Memchr::new method.

The lifetime parameter 'h refers to the lifetime of the haystack being searched.

Implementations

impl<'h> Memchr<'h>

fn new(needle1: u8, haystack: &'h [u8]) -> Memchr<'h>

Returns an iterator over all occurrences of the needle byte 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 Memchr<'h>

fn clone(&self) -> Self

impl<'h> Debug for Memchr<'h>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'h> DoubleEndedIterator for Memchr<'h>

fn next_back(&mut self) -> Option<usize>

impl<'h> FusedIterator for Memchr<'h>

impl<'h> Iterator for Memchr<'h>

type Item = usize;
fn next(&mut self) -> Option<usize>
fn count(self) -> usize
fn size_hint(&self) -> (usize, Option<usize>)

Auto Trait Implementations

impl<'h> Freeze for Memchr<'h>

impl<'h> RefUnwindSafe for Memchr<'h>

impl<'h> Send for Memchr<'h>

impl<'h> Sync for Memchr<'h>

impl<'h> Unpin for Memchr<'h>

impl<'h> UnsafeUnpin for Memchr<'h>

impl<'h> UnwindSafe for Memchr<'h>

Blanket Implementations

impl<I> IntoIterator for Memchr<'h> where I: Iterator,

impl<T> Any for Memchr<'h> where T: 'static + ?Sized,

impl<T> Borrow<T> for Memchr<'h> where T: ?Sized,

impl<T> BorrowMut<T> for Memchr<'h> where T: ?Sized,

impl<T> CloneToUninit for Memchr<'h> where T: Clone,

impl<T> From<T> for Memchr<'h>

impl<T> ToOwned for Memchr<'h> where T: Clone,

impl<T, U> Into<U> for Memchr<'h> where U: From<T>,

impl<T, U> TryFrom<U> for Memchr<'h> where U: Into<T>,

impl<T, U> TryInto<U> for Memchr<'h> where U: TryFrom<T>,