Function brownstone::try_build_with[][src]

pub fn try_build_with<T, F, E, const N: usize>(
    next_value: F
) -> Result<[T; N], TryBuildError<E>> where
    F: for<'a> FnMut(&'a mut [T]) -> 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 context in the form of the prefix of the array that has already been initialized.