Module random

Source

Macros§

define_rng
Use this to define a unique type which will be used as a key to retrieve an independent rng instance when calling .get_rng.

Traits§

ContextRandomExt
RngId

Functions§

sample_multiple_from_known_length
Sample multiple random elements uniformly without replacement from a container of known length. This function assumes set.len() >= requested.
sample_multiple_l_reservoir
Sample multiple random elements uniformly without replacement from a container of known length. If more samples are requested than are in the set, the function returns as many items as it can.
sample_single_from_known_length
Sample a random element uniformly from a container of known length.
sample_single_l_reservoir
Sample a random element uniformly from a container of unknown length.