pub enum Backend {
Default,
Urandom,
}Expand description
Selects the source of randomness the engine draws from.
Mirrors Hypothesis’s backend setting (specifically backend="hypothesis"
vs backend="hypothesis-urandom").
Variants§
Default
The default: generate from a seeded pseudo-random generator. Runs are
reproducible from Settings::seed and shrinking/replay work as usual.
Urandom
Read fresh entropy from /dev/urandom on every draw, instead of
expanding a single PRNG seed.
This exists for running under Antithesis,
whose fuzzer controls the bytes returned by /dev/urandom. Sourcing
every choice from the OS random device hands the fuzzer control over
the entire test case (rather than just the PRNG seed), so it can steer
and reproduce generation directly. When running inside Antithesis this
backend is selected automatically unless you set one explicitly.
The generation algorithm is otherwise unchanged — only the random
source differs. On platforms without /dev/urandom (Windows) it falls
back to an OS-seeded PRNG. You almost certainly don’t want this backend
unless you are running under Antithesis.