try_map

Function try_map 

Source
pub(crate) fn try_map<T: Send, E: Send>(
    count: usize,
    parallel: bool,
    map: impl Fn(usize) -> Result<T, E> + Sync + Send,
) -> Result<Vec<T>, E>
Expand description

map over 0..count, collected in index order and stopping at the first error.