pub struct SystemRandom(/* private fields */);
A secure random number generator where the random values come directly from the operating system.
“Directly from the operating system” here presently means “whatever the
getrandom crate does” but that may change in the future. That roughly
means calling libc’s
getrandom function or whatever is analogous to that;
getrandom crate’s documentation for more info.
SystemRandom may be shared across multiple threads safely.
new() is guaranteed to always succeed and to have low latency; it won’t
try to open or read from a file or do similar things. The first call to
fill() may block a substantial amount of time since any and all
initialization is deferred to it. Therefore, it may be a good idea to call
fill() once at a non-latency-sensitive time to minimize latency for