Function brownstone::try_build_indexed[][src]

pub fn try_build_indexed<T, F, E, const N: usize>(
    next_value: F
) -> Result<[T; N], TryBuildError<E>> where
    F: FnMut(usize) -> Result<T, E>, 
Expand description

Build a fixed-size array with a fallible initializer function. The initializer is called once for each item in the length of the array, in order; if it ever returns an Err, that error is propagated (along with the index of the failed item).

Each time the method is called, it is provided with the index of the element being produced.