Function inplace_it::inplace_fixed_size_array
source · pub fn inplace_fixed_size_array<T: FixedArray, Result, Init: Fn(usize) -> T::Item, Consumer: Fn(&mut [T::Item]) -> Result>(
init: Init,
consumer: Consumer
) -> Result
Expand description
inplace_fixed_size_array
is used when inplace_array
realize that the size of requested array of T
is small enough and should be replaced on the stack.
It use inplace
function to place the array on the stack and fills it up with help of init
closure
and then pass a reference to a slice of the vector into the consumer
closure.
consumer
’s result will be returned.