[][src]Module out::slice

Functions for use with slices.

Examples

let mut v = [-5, 4, 1, -3, 2];
let max = out::slice::max(&mut v, 3);
assert_eq!(max, [1, 2, 4]);
assert_eq!(v, [-3, 1, 2, 4, -5]);

Functions

max

Returns the n largest items.

max_by

Returns the n largest items with a comparator function.

max_by_cached_key

Returns the n largest items with a key extraction function.

max_by_key

Returns the n largest items with a key extraction function.

max_unstable

Returns the n largest items.

max_unstable_by

Returns the n largest items with a comparator function.

max_unstable_by_key

Returns the n largest items with a key extraction function.

min

Returns the n smallest items.

min_by

Returns the n smallest items with a comparator function.

min_by_cached_key

Returns the n smallest items with a key extraction function.

min_by_key

Returns the n smallest items with a key extraction function.

min_unstable

Returns the n smallest items.

min_unstable_by

Returns the n smallest items with a comparator function.

min_unstable_by_key

Returns the n smallest items with a key extraction function.