Trait InPlaceIterable
pub unsafe trait InPlaceIterable
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.
Associated Constants
const EXPAND_BY: Option<NonZero<usize>>;The product of one-to-many item expansions that happen throughout the iterator pipeline. E.g. [[u8; 4]; 4].iter().flatten().flatten() would have a
EXPAND_BYof 16. This is an upper bound, i.e. the transformations will produce at most this many items per input. It's meant for layout calculations.const MERGE_BY: Option<NonZero<usize>>;The product of many-to-one item reductions that happen throughout the iterator pipeline. E.g. [u8].iter().array_chunks::<4>().array_chunks::<4>() would have a
MERGE_BYof 16. This is a lower bound, i.e. the transformations will consume at least this many items per output.
Implementors
impl<A: InPlaceIterable, B> InPlaceIterable for Zip<A, B>impl<I, R> InPlaceIterable for GenericShunt<'_, I, R> where I: InPlaceIterable,impl<I: InPlaceIterable + Iterator, const N: usize> InPlaceIterable for ArrayChunks<I, N>impl<I: InPlaceIterable> InPlaceIterable for Cloned<I>impl<I: InPlaceIterable> InPlaceIterable for Copied<I>impl<I: InPlaceIterable> InPlaceIterable for Enumerate<I>impl<I: InPlaceIterable> InPlaceIterable for Skip<I>impl<I: InPlaceIterable> InPlaceIterable for Take<I>impl<I: InPlaceIterable, F> InPlaceIterable for FilterMap<I, F>impl<I: InPlaceIterable, F> InPlaceIterable for Inspect<I, F>impl<I: InPlaceIterable, F> InPlaceIterable for Map<I, F>impl<I: InPlaceIterable, F> InPlaceIterable for SkipWhile<I, F>impl<I: InPlaceIterable, F> InPlaceIterable for TakeWhile<I, F>impl<I: InPlaceIterable, P> InPlaceIterable for Filter<I, P>impl<I: InPlaceIterable, P> InPlaceIterable for MapWhile<I, P>impl<St, F, I: InPlaceIterable> InPlaceIterable for Scan<I, St, F>