Struct Bytes

#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct Bytes<'a>(pub(in ::str) Copied<Iter<'a, u8>>);

An iterator over the bytes of a string slice.

This struct is created by the bytes method on str. See its documentation for more.

Fields

0: Copied<Iter<'a, u8>>

Trait Implementations

impl DoubleEndedIterator for Bytes<'_>

fn next_back(&mut self) -> Option<u8>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where
    P: FnMut(&Self::Item) -> bool,

impl ExactSizeIterator for Bytes<'_>

fn len(&self) -> usize
fn is_empty(&self) -> bool

impl FusedIterator for Bytes<'_>

impl Iterator for Bytes<'_>

type Item = u8;
fn next(&mut self) -> Option<u8>
fn size_hint(&self) -> (usize, Option<usize>)
fn count(self) -> usize
fn last(self) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
fn all<F>(&mut self, f: F) -> bool
where
    F: FnMut(Self::Item) -> bool,
fn any<F>(&mut self, f: F) -> bool
where
    F: FnMut(Self::Item) -> bool,
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where
    P: FnMut(&Self::Item) -> bool,
fn position<P>(&mut self, predicate: P) -> Option<usize>
where
    P: FnMut(Self::Item) -> bool,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where
    P: FnMut(Self::Item) -> bool,
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> u8

impl TrustedLen for Bytes<'_>

impl TrustedRandomAccess for Bytes<'_>

impl TrustedRandomAccessNoCoerce for Bytes<'_>

const MAY_HAVE_SIDE_EFFECT: bool = false;

impl<'a> Clone for Bytes<'a>

fn clone(&self) -> Self

impl<'a> Debug for Bytes<'a>

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

Auto Trait Implementations

impl<'a> Freeze for Bytes<'a>

impl<'a> RefUnwindSafe for Bytes<'a>

impl<'a> Send for Bytes<'a>

impl<'a> Sync for Bytes<'a>

impl<'a> Unpin for Bytes<'a>

impl<'a> UnsafeUnpin for Bytes<'a>

impl<'a> UnwindSafe for Bytes<'a>

Blanket Implementations

impl<I> IntoIterator for Bytes<'a> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for Bytes<'a> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Bytes<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Bytes<'a> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Bytes<'a> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Bytes<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for Bytes<'a> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for Bytes<'a>

impl<T, U> Into<U> for Bytes<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Bytes<'a> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Bytes<'a> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>