-
-
Notifications
You must be signed in to change notification settings - Fork 465
Implement Read
for some wrapper of Rng
in terms of fill_bytes
or try_fill_bytes
#254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That shouldn't be hard to do. Is there good reason for including it within the |
That's absolutely true. I would argue that in the same way, it's possible to implement |
Making |
This could live in |
Now |
Hey folks. I wanted to be able to take an
Rng
and shove it into a function that expectsR: Read
, i.e. treat it as an endless bytestream. There doesn't seem to be a nice convenient way out there to, say, turn theRng
into an iterator and then that into aRead
, anyhow it makes sense to me to giveRng
the capabilities ofRead
(sinceRead
just says, "fill up this buffer with random bytes, please!") which one might note,Rng
already supports. Why not implementRead
for some wrapper aroundRng
in terms oftry_fill_bytes
? Perhapsstruct ReadableRng<R: Rng>(R);
.The text was updated successfully, but these errors were encountered: