pub fn getrandom(dest: &mut [u8]) -> Result<(), Error>
dest with random bytes from the system's preferred random number
This function returns an error on any failure, including partial reads. We
make no guarantees regarding the contents of
dest on error. If
getrandom immediately returns success, making no calls to the
underlying operating system.
Blocking is possible, at least during early boot; see module documentation.
getrandom will be fast enough for interactive usage, though
significantly slower than a user-space CSPRNG; for the latter consider