Skip to main content

map

Function map 

Source
pub fn map<T: Sync, R: Send>(
    items: &[T],
    f: impl Fn(&T) -> R + Sync + Send,
) -> Vec<R>
Expand description

items のそれぞれに f をかけ、結果を入力の順に返す(逐次の指定の中では逐次)。 要素ごとに独立に計算するので、スレッド数によらず結果は同じ