Skip to content
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

Recommended text for seed documentation #240

Closed
xpe opened this issue Jan 17, 2018 · 1 comment
Closed

Recommended text for seed documentation #240

xpe opened this issue Jan 17, 2018 · 1 comment

Comments

@xpe
Copy link

xpe commented Jan 17, 2018

Recommendation

I'd suggest adding some more context to:
https://docs.rs/rand/0.4.2/rand/trait.SeedableRng.html

Currently, it says:

Create a new RNG with the given seed.

Example 
...

I'd suggest adding text so that it looks more like this:

Create a new RNG with the given seed.

Note: the seed varies based on the chosen generator. Most RNG's 
expect `&'a [u32]` values but some expect `&'a [u64]`. Please refer to
the particular RNG documentation for the length of the seed.

Example 
...

Motivation

When I first looked into how seeds worked in this library, I tried to find a definition of Seed to get some clarity. That didn't help much, since Seed is a generic for the SeedableRng trait.

pub trait SeedableRng<Seed>: Rng {
    fn reseed(&mut self, Seed);
    fn from_seed(seed: Seed) -> Self;
}

Particularly for people new to the library, saying a few words about what a Seed is may help.

@dhardy
Copy link
Member

dhardy commented Jan 18, 2018

Take a look at dhardy#18 if you want to know what plans are in store; this trait is being heavily revised (part of that is restrictions on Seed).

@dhardy dhardy closed this as completed Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants