Skip to content

Recommended text for seed documentation #240

@xpe

Description

@xpe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions