Closed dhardy closed 6 years ago
Also: how should we handle NotReady
?
This code sleeps for 10ms, except no_std
provides no interface for this so in that case the code retries immediately. Do we have another option? Is busy-waiting acceptable?
The second commit allows OsRng
to return NotReady
, in theory (Linux only, and only if getrandom is available). I don't know how to test this.
How does it interact with the implicit handling? Since OsRng
is only available with std
, it should loop with 10ms sleep intervals, in theory: possibly slightly more CPU usage and slightly more wait time, but probably insignificant.
Add rand_core::impls::fill_via_try_fill with handling for errors.
I'm not completely happy about this but it does roughly meet the requirements in #25.
Using a global error counter is a bit weird, but seems better than adding a local error counter (e.g.
ReadRng
uses this impl, but can't actually emit theTransient
error in any case).In fact, no current code emits either
Transient
orNotReady
.Also, I think the best option for printing error causes when panicking is to log?