SplitWhitespace

Struct SplitWhitespace 

Source
pub struct SplitWhitespace<'s> { /* private fields */ }
Expand description

Represents iterators over the non-whitespace non-empty substrings of non-empty strings.

Note that this struct does not implement NonEmptyIterator as the iterator can be empty, specifically, if the input string consists of whitespace only.

This struct is created by the split_whitespace method on NonEmptyStr.

Implementations§

Source§

impl<'s> SplitWhitespace<'s>

Source

pub const fn new(string: &'s NonEmptyStr) -> Self

Constructs Self.

Trait Implementations§

Source§

impl<'s> Debug for SplitWhitespace<'s>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'s> IntoIterator for SplitWhitespace<'s>

Source§

type Item = &'s NonEmptyStr

The type of the elements being iterated over.
Source§

type IntoIter = Map<SplitWhitespace<'s>, fn(&'s str) -> &'s NonEmptyStr>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'s> Freeze for SplitWhitespace<'s>

§

impl<'s> RefUnwindSafe for SplitWhitespace<'s>

§

impl<'s> Send for SplitWhitespace<'s>

§

impl<'s> Sync for SplitWhitespace<'s>

§

impl<'s> Unpin for SplitWhitespace<'s>

§

impl<'s> UnwindSafe for SplitWhitespace<'s>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<I> TryIntoNonEmptyIterator for I
where I: IntoIterator,

Source§

type Item = <I as IntoIterator>::Item

The type of the items being iterated over.
Source§

type IntoNonEmptyIter = NonEmptyAdapter<Peekable<<I as IntoIterator>::IntoIter>>

Which kind of NonEmptyIterator are we turning this into?
Source§

fn try_into_non_empty_iter( self, ) -> Option<<I as TryIntoNonEmptyIterator>::IntoNonEmptyIter>

Tries to convert self into NonEmptyIterator. Read more