Trait std::iter::InPlaceIterable
source · pub unsafe trait InPlaceIterable: Iterator { }
🔬This is a nightly-only experimental API. (
inplace_iteration
)Expand description
An iterator that when yielding an item will have taken at least one element
from its underlying SourceIter
.
Calling any method that advances the iterator, e.g. next()
or try_fold()
,
guarantees that for each step at least one value of the iterator’s underlying source
has been moved out and the result of the iterator chain could be inserted
in its place, assuming structural constraints of the source allow such an insertion.
In other words this trait indicates that an iterator pipeline can be collected in place.
The primary use of this trait is in-place iteration. Refer to the vec::in_place_collect
module documentation for more information.