std.slice
fn-pointer predicate helpers over []T (find, count_where, any, all, …)
pub find :: fn($T: type, s: []T, pred: fn(T) -> bool) -> ?usizeindex of the first match, or null
count_where
Section titled “count_where”pub count_where :: fn($T: type, s: []T, pred: fn(T) -> bool) -> usizenumber of matches
pub any :: fn($T: type, s: []T, pred: fn(T) -> bool) -> boolpub all :: fn($T: type, s: []T, pred: fn(T) -> bool) -> boolpub each :: fn($T: type, s: []T, f: fn(T))map_into
Section titled “map_into”pub map_into :: fn($T: type, $U: type, dst: []U, src: []T, f: fn(T) -> U) -> usizedst[i] = f(src[i]) over the shorter length; returns that length
pub rfind :: fn($T: type, s: []T, pred: fn(T) -> bool) -> ?usizeindex of the last match, or null