Function stackalloc::stackalloc_from_iter_exact
source · [−]pub fn stackalloc_from_iter_exact<I, T, U, F>(iter: I, callback: F) -> U where
F: FnOnce(&mut [T]) -> U,
I: IntoIterator<Item = T>,
I::IntoIter: ExactSizeIterator,
Expand description
Collect an exact size iterator into a stack allocated slice, call callback
with this buffer, and then drop and deallocate the buffer.
See stackalloc_with_iter()
.
Size
If the implementation of ExactSizeIterator
on I
is incorrect and reports a longer length than the iterator actually produces, then the slice passed to callback
is shortened to the number of elements actually produced.