Skip to main content

index

Function index 

Source
pub fn index(len: usize) -> usize
Expand description

Chooses a uniformly random index below len.

A zero length returns 0 instead of sampling an empty range. For any nonzero length, the result lies in 0..len.