pub struct SplitWhitespace<'a> {/* private fields */ }Expand description
An iterator over the non-whitespace substrings of a string,separated by any amount of whitespace.
This struct is created by thesplit_whitespace method onstr.See its documentation for more.
Implementations§
Trait Implementations§
1.1.0 ·Source§impl<'a>Clone forSplitWhitespace<'a>
impl<'a>Clone forSplitWhitespace<'a>
1.0.0 ·Source§fnclone_from(&mut self, source: &Self)
fnclone_from(&mut self, source: &Self)
Performs copy-assignment from
source.Read more1.1.0 ·Source§impl<'a>Debug forSplitWhitespace<'a>
impl<'a>Debug forSplitWhitespace<'a>
1.1.0 ·Source§impl<'a>DoubleEndedIterator forSplitWhitespace<'a>
impl<'a>DoubleEndedIterator forSplitWhitespace<'a>
Source§fnnext_back(&mut self) ->Option<&'astr>
fnnext_back(&mut self) ->Option<&'astr>
Removes and returns an element from the end of the iterator.Read more
Source§fnadvance_back_by(&mut self, n:usize) ->Result<(),NonZero<usize>>
fnadvance_back_by(&mut self, n:usize) ->Result<(),NonZero<usize>>
🔬This is a nightly-only experimental API. (
iter_advance_by #77404)Advances the iterator from the back by
n elements.Read more1.37.0 ·Source§fnnth_back(&mut self, n:usize) ->Option<Self::Item>
fnnth_back(&mut self, n:usize) ->Option<Self::Item>
Returns the
nth element from the end of the iterator.Read more1.27.0 ·Source§fntry_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fntry_rfold<B, F, R>(&mut self, init: B, f: F) -> R
This is the reverse version of
Iterator::try_fold(): it takeselements starting from the back of the iterator.Read more1.1.0 ·Source§impl<'a>Iterator forSplitWhitespace<'a>
impl<'a>Iterator forSplitWhitespace<'a>
Source§fnsize_hint(&self) -> (usize,Option<usize>)
fnsize_hint(&self) -> (usize,Option<usize>)
Returns the bounds on the remaining length of the iterator.Read more
Source§fnnext_chunk<const N:usize>( &mut self,) ->Result<[Self::Item;N],IntoIter<Self::Item, N>>where Self:Sized,
fnnext_chunk<const N:usize>( &mut self,) ->Result<[Self::Item;N],IntoIter<Self::Item, N>>where Self:Sized,
🔬This is a nightly-only experimental API. (
iter_next_chunk #98326)Advances the iterator and returns an array containing the next
N values.Read more1.0.0 ·Source§fncount(self) ->usizewhere Self:Sized,
fncount(self) ->usizewhere Self:Sized,
Consumes the iterator, counting the number of iterations and returning it.Read more
Source§fnadvance_by(&mut self, n:usize) ->Result<(),NonZero<usize>>
fnadvance_by(&mut self, n:usize) ->Result<(),NonZero<usize>>
🔬This is a nightly-only experimental API. (
iter_advance_by #77404)Advances the iterator by
n elements.Read more1.0.0 ·Source§fnnth(&mut self, n:usize) ->Option<Self::Item>
fnnth(&mut self, n:usize) ->Option<Self::Item>
Returns the
nth element of the iterator.Read more1.28.0 ·Source§fnstep_by(self, step:usize) ->StepBy<Self>ⓘwhere Self:Sized,
fnstep_by(self, step:usize) ->StepBy<Self>ⓘwhere Self:Sized,
Creates an iterator starting at the same point, but stepping bythe given amount at each iteration.Read more
1.0.0 ·Source§fnchain<U>(self, other: U) ->Chain<Self, <U asIntoIterator>::IntoIter>ⓘ
fnchain<U>(self, other: U) ->Chain<Self, <U asIntoIterator>::IntoIter>ⓘ
Takes two iterators and creates a new iterator over both in sequence.Read more
1.0.0 ·Source§fnzip<U>(self, other: U) ->Zip<Self, <U asIntoIterator>::IntoIter>ⓘwhere Self:Sized, U:IntoIterator,
fnzip<U>(self, other: U) ->Zip<Self, <U asIntoIterator>::IntoIter>ⓘwhere Self:Sized, U:IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs.Read more
Source§fnintersperse(self, separator: Self::Item) ->Intersperse<Self>ⓘ
fnintersperse(self, separator: Self::Item) ->Intersperse<Self>ⓘ
🔬This is a nightly-only experimental API. (
iter_intersperse #79524)Creates a new iterator which places a copy of
separator between adjacentitems of the original iterator.Read moreSource§fnintersperse_with<G>(self, separator: G) ->IntersperseWith<Self, G>ⓘ
fnintersperse_with<G>(self, separator: G) ->IntersperseWith<Self, G>ⓘ
🔬This is a nightly-only experimental API. (
iter_intersperse #79524)Creates a new iterator which places an item generated by
separatorbetween adjacent items of the original iterator.Read more1.0.0 ·Source§fnmap<B, F>(self, f: F) ->Map<Self, F>ⓘ
fnmap<B, F>(self, f: F) ->Map<Self, F>ⓘ
Takes a closure and creates an iterator which calls that closure on eachelement.Read more
1.0.0 ·Source§fnfilter<P>(self, predicate: P) ->Filter<Self, P>ⓘ
fnfilter<P>(self, predicate: P) ->Filter<Self, P>ⓘ
Creates an iterator which uses a closure to determine if an elementshould be yielded.Read more
1.0.0 ·Source§fnfilter_map<B, F>(self, f: F) ->FilterMap<Self, F>ⓘ
fnfilter_map<B, F>(self, f: F) ->FilterMap<Self, F>ⓘ
Creates an iterator that both filters and maps.Read more
1.0.0 ·Source§fnenumerate(self) ->Enumerate<Self>ⓘwhere Self:Sized,
fnenumerate(self) ->Enumerate<Self>ⓘwhere Self:Sized,
Creates an iterator which gives the current iteration count as well asthe next value.Read more
1.0.0 ·Source§fnskip_while<P>(self, predicate: P) ->SkipWhile<Self, P>ⓘ
fnskip_while<P>(self, predicate: P) ->SkipWhile<Self, P>ⓘ
1.0.0 ·Source§fntake_while<P>(self, predicate: P) ->TakeWhile<Self, P>ⓘ
fntake_while<P>(self, predicate: P) ->TakeWhile<Self, P>ⓘ
Creates an iterator that yields elements based on a predicate.Read more
1.57.0 ·Source§fnmap_while<B, P>(self, predicate: P) ->MapWhile<Self, P>ⓘ
fnmap_while<B, P>(self, predicate: P) ->MapWhile<Self, P>ⓘ
Creates an iterator that both yields elements based on a predicate and maps.Read more
1.0.0 ·Source§fnskip(self, n:usize) ->Skip<Self>ⓘwhere Self:Sized,
fnskip(self, n:usize) ->Skip<Self>ⓘwhere Self:Sized,
Creates an iterator that skips the first
n elements.Read more1.0.0 ·Source§fntake(self, n:usize) ->Take<Self>ⓘwhere Self:Sized,
fntake(self, n:usize) ->Take<Self>ⓘwhere Self:Sized,
Creates an iterator that yields the first
n elements, or fewerif the underlying iterator ends sooner.Read more1.0.0 ·Source§fnflat_map<U, F>(self, f: F) ->FlatMap<Self, U, F>ⓘ
fnflat_map<U, F>(self, f: F) ->FlatMap<Self, U, F>ⓘ
Creates an iterator that works like map, but flattens nested structure.Read more
1.29.0 ·Source§fnflatten(self) ->Flatten<Self>ⓘ
fnflatten(self) ->Flatten<Self>ⓘ
Creates an iterator that flattens nested structure.Read more
Source§fnmap_windows<F, R, const N:usize>(self, f: F) ->MapWindows<Self, F, N>ⓘ
fnmap_windows<F, R, const N:usize>(self, f: F) ->MapWindows<Self, F, N>ⓘ
🔬This is a nightly-only experimental API. (
iter_map_windows #87155)Calls the given function
f for each contiguous window of sizeN overself and returns an iterator over the outputs off. Likeslice::windows(),the windows during mapping overlap as well.Read more1.0.0 ·Source§fninspect<F>(self, f: F) ->Inspect<Self, F>ⓘ
fninspect<F>(self, f: F) ->Inspect<Self, F>ⓘ
Does something with each element of an iterator, passing the value on.Read more
1.0.0 ·Source§fnby_ref(&mut self) -> &mut Selfwhere Self:Sized,
fnby_ref(&mut self) -> &mut Selfwhere Self:Sized,
Creates a “by reference” adapter for this instance of
Iterator.Read moreSource§fntry_collect<B>( &mut self,) -> <<Self::Item asTry>::Residual asResidual<B>>::TryType
fntry_collect<B>( &mut self,) -> <<Self::Item asTry>::Residual asResidual<B>>::TryType
🔬This is a nightly-only experimental API. (
iterator_try_collect #94047)Fallibly transforms an iterator into a collection, short circuiting ifa failure is encountered.Read more
Source§fncollect_into<E>(self, collection:&mut E) ->&mut E
fncollect_into<E>(self, collection:&mut E) ->&mut E
🔬This is a nightly-only experimental API. (
iter_collect_into #94780)Collects all the items from an iterator into a collection.Read more
1.0.0 ·Source§fnpartition<B, F>(self, f: F) ->(B, B)
fnpartition<B, F>(self, f: F) ->(B, B)
Consumes an iterator, creating two collections from it.Read more
Source§fnpartition_in_place<'a, T, P>(self, predicate: P) ->usize
fnpartition_in_place<'a, T, P>(self, predicate: P) ->usize
🔬This is a nightly-only experimental API. (
iter_partition_in_place #62543)Reorders the elements of this iteratorin-place according to the given predicate,such that all those that return
true precede all those that returnfalse.Returns the number oftrue elements found.Read moreSource§fnis_partitioned<P>(self, predicate: P) ->bool
fnis_partitioned<P>(self, predicate: P) ->bool
🔬This is a nightly-only experimental API. (
iter_is_partitioned #62544)Checks if the elements of this iterator are partitioned according to the given predicate,such that all those that return
true precede all those that returnfalse.Read more1.27.0 ·Source§fntry_fold<B, F, R>(&mut self, init: B, f: F) -> R
fntry_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returnssuccessfully, producing a single, final value.Read more
1.27.0 ·Source§fntry_for_each<F, R>(&mut self, f: F) -> R
fntry_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in theiterator, stopping at the first error and returning that error.Read more
1.0.0 ·Source§fnfold<B, F>(self, init: B, f: F) -> B
fnfold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,returning the final result.Read more
1.51.0 ·Source§fnreduce<F>(self, f: F) ->Option<Self::Item>
fnreduce<F>(self, f: F) ->Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducingoperation.Read more
Source§fntry_reduce<R>( &mut self, f: implFnMut(Self::Item, Self::Item) -> R,) -> <<R asTry>::Residual asResidual<Option<<R asTry>::Output>>>::TryType
fntry_reduce<R>( &mut self, f: implFnMut(Self::Item, Self::Item) -> R,) -> <<R asTry>::Residual asResidual<Option<<R asTry>::Output>>>::TryType
🔬This is a nightly-only experimental API. (
iterator_try_reduce #87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If theclosure returns a failure, the failure is propagated back to the caller immediately.Read more
1.0.0 ·Source§fnall<F>(&mut self, f: F) ->bool
fnall<F>(&mut self, f: F) ->bool
Tests if every element of the iterator matches a predicate.Read more
1.0.0 ·Source§fnany<F>(&mut self, f: F) ->bool
fnany<F>(&mut self, f: F) ->bool
Tests if any element of the iterator matches a predicate.Read more
1.0.0 ·Source§fnfind<P>(&mut self, predicate: P) ->Option<Self::Item>
fnfind<P>(&mut self, predicate: P) ->Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate.Read more
1.30.0 ·Source§fnfind_map<B, F>(&mut self, f: F) ->Option<B>
fnfind_map<B, F>(&mut self, f: F) ->Option<B>
Applies function to the elements of iterator and returnsthe first non-none result.Read more
Source§fntry_find<R>( &mut self, f: implFnMut(&Self::Item) -> R,) -> <<R asTry>::Residual asResidual<Option<Self::Item>>>::TryType
fntry_find<R>( &mut self, f: implFnMut(&Self::Item) -> R,) -> <<R asTry>::Residual asResidual<Option<Self::Item>>>::TryType
🔬This is a nightly-only experimental API. (
try_find #63178)Applies function to the elements of iterator and returnsthe first true result or the first error.Read more
1.0.0 ·Source§fnposition<P>(&mut self, predicate: P) ->Option<usize>
fnposition<P>(&mut self, predicate: P) ->Option<usize>
Searches for an element in an iterator, returning its index.Read more
1.0.0 ·Source§fnrposition<P>(&mut self, predicate: P) ->Option<usize>
fnrposition<P>(&mut self, predicate: P) ->Option<usize>
Searches for an element in an iterator from the right, returning itsindex.Read more
1.6.0 ·Source§fnmax_by_key<B, F>(self, f: F) ->Option<Self::Item>
fnmax_by_key<B, F>(self, f: F) ->Option<Self::Item>
Returns the element that gives the maximum value from thespecified function.Read more
1.15.0 ·Source§fnmax_by<F>(self, compare: F) ->Option<Self::Item>
fnmax_by<F>(self, compare: F) ->Option<Self::Item>
Returns the element that gives the maximum value with respect to thespecified comparison function.Read more
1.6.0 ·Source§fnmin_by_key<B, F>(self, f: F) ->Option<Self::Item>
fnmin_by_key<B, F>(self, f: F) ->Option<Self::Item>
Returns the element that gives the minimum value from thespecified function.Read more
1.15.0 ·Source§fnmin_by<F>(self, compare: F) ->Option<Self::Item>
fnmin_by<F>(self, compare: F) ->Option<Self::Item>
Returns the element that gives the minimum value with respect to thespecified comparison function.Read more
1.0.0 ·Source§fnrev(self) ->Rev<Self>ⓘwhere Self:Sized +DoubleEndedIterator,
fnrev(self) ->Rev<Self>ⓘwhere Self:Sized +DoubleEndedIterator,
Reverses an iterator’s direction.Read more
1.0.0 ·Source§fnunzip<A, B, FromA, FromB>(self) ->(FromA, FromB)
fnunzip<A, B, FromA, FromB>(self) ->(FromA, FromB)
Converts an iterator of pairs into a pair of containers.Read more
1.36.0 ·Source§fncopied<'a, T>(self) ->Copied<Self>ⓘ
fncopied<'a, T>(self) ->Copied<Self>ⓘ
Creates an iterator which copies all of its elements.Read more
Source§fnarray_chunks<const N:usize>(self) ->ArrayChunks<Self, N>ⓘwhere Self:Sized,
fnarray_chunks<const N:usize>(self) ->ArrayChunks<Self, N>ⓘwhere Self:Sized,
🔬This is a nightly-only experimental API. (
iter_array_chunks #100450)Returns an iterator over
N elements of the iterator at a time.Read more1.11.0 ·Source§fnproduct<P>(self) -> P
fnproduct<P>(self) -> P
Iterates over the entire iterator, multiplying all the elementsRead more
Source§fncmp_by<I, F>(self, other: I, cmp: F) ->Ordering
fncmp_by<I, F>(self, other: I, cmp: F) ->Ordering
🔬This is a nightly-only experimental API. (
iter_order_by #64295)Lexicographically compares the elements of this
Iterator with thoseof another with respect to the specified comparison function.Read more1.5.0 ·Source§fnpartial_cmp<I>(self, other: I) ->Option<Ordering>
fnpartial_cmp<I>(self, other: I) ->Option<Ordering>
Lexicographically compares the
PartialOrd elements ofthisIterator with those of another. The comparison works like short-circuitevaluation, returning a result without comparing the remaining elements.As soon as an order can be determined, the evaluation stops and a result is returned.Read moreSource§fnpartial_cmp_by<I, F>(self, other: I, partial_cmp: F) ->Option<Ordering>
fnpartial_cmp_by<I, F>(self, other: I, partial_cmp: F) ->Option<Ordering>
🔬This is a nightly-only experimental API. (
iter_order_by #64295)Lexicographically compares the elements of this
Iterator with thoseof another with respect to the specified comparison function.Read moreSource§fneq_by<I, F>(self, other: I, eq: F) ->bool
fneq_by<I, F>(self, other: I, eq: F) ->bool
🔬This is a nightly-only experimental API. (
iter_order_by #64295)1.5.0 ·Source§fnle<I>(self, other: I) ->bool
fnle<I>(self, other: I) ->bool
Determines if the elements of this
Iterator arelexicographicallyless or equal to those of another.Read more1.5.0 ·Source§fngt<I>(self, other: I) ->bool
fngt<I>(self, other: I) ->bool
Determines if the elements of this
Iterator arelexicographicallygreater than those of another.Read more1.5.0 ·Source§fnge<I>(self, other: I) ->bool
fnge<I>(self, other: I) ->bool
Determines if the elements of this
Iterator arelexicographicallygreater than or equal to those of another.Read more1.82.0 ·Source§fnis_sorted_by<F>(self, compare: F) ->bool
fnis_sorted_by<F>(self, compare: F) ->bool
Checks if the elements of this iterator are sorted using the given comparator function.Read more
1.82.0 ·Source§fnis_sorted_by_key<F, K>(self, f: F) ->bool
fnis_sorted_by_key<F, K>(self, f: F) ->bool
Checks if the elements of this iterator are sorted using the given key extractionfunction.Read more
implFusedIterator forSplitWhitespace<'_>
Auto Trait Implementations§
impl<'a>Freeze forSplitWhitespace<'a>
impl<'a>RefUnwindSafe forSplitWhitespace<'a>
impl<'a>Send forSplitWhitespace<'a>
impl<'a>Sync forSplitWhitespace<'a>
impl<'a>Unpin forSplitWhitespace<'a>
impl<'a>UnwindSafe forSplitWhitespace<'a>
Blanket Implementations§
Source§impl<T>BorrowMut<T> for Twhere T: ?Sized,
impl<T>BorrowMut<T> for Twhere T: ?Sized,
Source§fnborrow_mut(&mut self) ->&mut T
fnborrow_mut(&mut self) ->&mut T
Mutably borrows from an owned value.Read more