Trait rand::Rng
An automatically-implemented extension trait on RngCore providing high-level generic methods for sampling values and other convenience methods.
This is the primary trait to use when generating random values.
fill_bytes() comes from RngCore but fill() and gen() comes from Rng.
Comments of 2nd update:
After reading more documents, I prefer switch to
fill()
orgen()
instead offill_bytes()
. The related Rand document:fill_bytes()
comes fromRngCore
butfill()
andgen()
comes fromRng
.