Struct SplitWhitespace

struct SplitWhitespace<'a> { ... }

An iterator over the non-whitespace substrings of a string, separated by any amount of whitespace.

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

Implementations

impl<'a> SplitWhitespace<'a>

fn remainder(self: &Self) -> Option<&'a str>

Returns remainder of the split string

Examples

#![feature(str_split_whitespace_remainder)]

let mut split = "Mary had a little lamb".split_whitespace();
assert_eq!(split.remainder(), Some("Mary had a little lamb"));

split.next();
assert_eq!(split.remainder(), Some("had a little lamb"));

split.by_ref().for_each(drop);
assert_eq!(split.remainder(), None);

impl FusedIterator for SplitWhitespace<'_>

impl<'a> Clone for SplitWhitespace<'a>

fn clone(self: &Self) -> SplitWhitespace<'a>

impl<'a> Debug for SplitWhitespace<'a>

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

impl<'a> DoubleEndedIterator for SplitWhitespace<'a>

fn next_back(self: &mut Self) -> Option<&'a str>

impl<'a> Freeze for SplitWhitespace<'a>

impl<'a> Iterator for SplitWhitespace<'a>

fn next(self: &mut Self) -> Option<&'a str>
fn size_hint(self: &Self) -> (usize, Option<usize>)
fn last(self: Self) -> Option<&'a str>

impl<'a> RefUnwindSafe for SplitWhitespace<'a>

impl<'a> Send for SplitWhitespace<'a>

impl<'a> Sync for SplitWhitespace<'a>

impl<'a> Unpin for SplitWhitespace<'a>

impl<'a> UnsafeUnpin for SplitWhitespace<'a>

impl<'a> UnwindSafe for SplitWhitespace<'a>

impl<I> IntoIterator for SplitWhitespace<'a>

fn into_iter(self: Self) -> I

impl<T> Any for SplitWhitespace<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for SplitWhitespace<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for SplitWhitespace<'a>

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

impl<T> CloneToUninit for SplitWhitespace<'a>

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

impl<T> From for SplitWhitespace<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for SplitWhitespace<'a>

fn into(self: 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 for SplitWhitespace<'a>

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

impl<T, U> TryInto for SplitWhitespace<'a>

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