Initialize an array given an initializer expression that may fail. The initializer is given the index (between 0 and `N - 1` included) of the element, and returns a `Result ,`. It is allowed to mutate external state; we will always initialize from lower to higher indices. # Examples ```rust # #![allow(unused)] # extern crate array_init; # #[derive(PartialEq,Eq,Debug)] struct DivideByZero
(initializer: F)
| 183 | /// assert_eq!(res,Err(DivideByZero)); |
| 184 | /// ``` |
| 185 | pub fn try_array_init<Err, F, T, const N: usize>(initializer: F) -> Result<[T; N], Err> |
| 186 | where |
| 187 | F: FnMut(usize) -> Result<T, Err>, |
| 188 | { |
| 189 | try_array_init_impl::<Err, F, T, N, 1>(initializer) |
| 190 | } |
| 191 | |
| 192 | #[inline] |
| 193 | fn try_array_init_impl<Err, F, T, const N: usize, const D: i8>( |
no outgoing calls