trait.SeedableRng.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SeedableRng` trait in crate `rand`."><meta name="keywords" content="rust, rustlang, rust-lang, SeedableRng"><title>rand::SeedableRng - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../rand/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk.png' alt='logo' width='100'></a><p class='location'>Trait SeedableRng</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Seed">Seed</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.from_seed">from_seed</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.from_rng">from_rng</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-SeedableRng">BlockRng&lt;R&gt;</a><a href="#impl-SeedableRng">BlockRng64&lt;R&gt;</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>rand</a></p><script>window.sidebarCurrent = {name: 'SeedableRng', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>rand</a>::<wbr><a class="trait" href=''>SeedableRng</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/rand_core/lib.rs.html#230-338' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust trait'>pub trait SeedableRng {
  2. type <a href='#associatedtype.Seed' class="type">Seed</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;;
  3. fn <a href='#tymethod.from_seed' class='fnname'>from_seed</a>(seed: Self::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>) -&gt; Self;
  4. fn <a href='#method.from_rng' class='fnname'>from_rng</a>&lt;R&gt;(rng: R) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="struct" href="../rand/struct.Error.html" title="struct rand::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../rand/trait.RngCore.html" title="trait rand::RngCore">RngCore</a></span>,
  5. { ... }
  6. }</pre></div><div class='docblock'><p>A random number generator that can be explicitly seeded.</p>
  7. <p>This trait encapsulates the low-level functionality common to all
  8. pseudo-random number generators (PRNGs, or algorithmic generators).</p>
  9. <p>The <a href="../rand/trait.FromEntropy.html"><code>rand::FromEntropy</code></a> trait is automatically implemented for every type
  10. implementing <code>SeedableRng</code>, providing a convenient <code>from_entropy()</code>
  11. constructor.</p>
  12. </div>
  13. <h2 id='associated-types' class='small-section-header'>
  14. Associated Types<a href='#associated-types' class='anchor'></a>
  15. </h2>
  16. <div class='methods'>
  17. <h3 id='associatedtype.Seed' class='method'><span id='Seed.t' class='invisible'><code>type <a href='#associatedtype.Seed' class="type">Seed</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h3><div class='docblock'><p>Seed type, which is restricted to types mutably-dereferencable as <code>u8</code>
  18. arrays (we recommend <code>[u8; N]</code> for some <code>N</code>).</p>
  19. <p>It is recommended to seed PRNGs with a seed of at least circa 100 bits,
  20. which means an array of <code>[u8; 12]</code> or greater to avoid picking RNGs with
  21. partially overlapping periods.</p>
  22. <p>For cryptographic RNG's a seed of 256 bits is recommended, <code>[u8; 32]</code>.</p>
  23. <h1 id="implementing-seedablerng-for-rngs-with-large-seeds" class="section-header"><a href="#implementing-seedablerng-for-rngs-with-large-seeds">Implementing <code>SeedableRng</code> for RNGs with large seeds</a></h1>
  24. <p>Note that the required traits <code>core::default::Default</code> and
  25. <code>core::convert::AsMut&lt;u8&gt;</code> are not implemented for large arrays
  26. <code>[u8; N]</code> with <code>N</code> &gt; 32. To be able to implement the traits required by
  27. <code>SeedableRng</code> for RNGs with such large seeds, the newtype pattern can be
  28. used:</p>
  29. <pre class="rust rust-example-rendered">
  30. <span class="kw">use</span> <span class="ident">rand_core</span>::<span class="ident">SeedableRng</span>;
  31. <span class="kw">const</span> <span class="ident">N</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">64</span>;
  32. <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MyRngSeed</span>(<span class="kw">pub</span> [<span class="ident">u8</span>; <span class="ident">N</span>]);
  33. <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MyRng</span>(<span class="ident">MyRngSeed</span>);
  34. <span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">MyRngSeed</span> {
  35. <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-&gt;</span> <span class="ident">MyRngSeed</span> {
  36. <span class="ident">MyRngSeed</span>([<span class="number">0</span>; <span class="ident">N</span>])
  37. }
  38. }
  39. <span class="kw">impl</span> <span class="ident">AsMut</span><span class="op">&lt;</span>[<span class="ident">u8</span>]<span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">MyRngSeed</span> {
  40. <span class="kw">fn</span> <span class="ident">as_mut</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-&gt;</span> <span class="kw-2">&amp;</span><span class="kw-2">mut</span> [<span class="ident">u8</span>] {
  41. <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="number">0</span>
  42. }
  43. }
  44. <span class="kw">impl</span> <span class="ident">SeedableRng</span> <span class="kw">for</span> <span class="ident">MyRng</span> {
  45. <span class="kw">type</span> <span class="ident">Seed</span> <span class="op">=</span> <span class="ident">MyRngSeed</span>;
  46. <span class="kw">fn</span> <span class="ident">from_seed</span>(<span class="ident">seed</span>: <span class="ident">MyRngSeed</span>) <span class="op">-&gt;</span> <span class="ident">MyRng</span> {
  47. <span class="ident">MyRng</span>(<span class="ident">seed</span>)
  48. }
  49. }</pre>
  50. </div></div>
  51. <h2 id='required-methods' class='small-section-header'>
  52. Required Methods<a href='#required-methods' class='anchor'></a>
  53. </h2>
  54. <div class='methods'>
  55. <h3 id='tymethod.from_seed' class='method'><span id='from_seed.v' class='invisible'><code>fn <a href='#tymethod.from_seed' class='fnname'>from_seed</a>(seed: Self::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>) -&gt; Self</code></span></h3><div class='docblock'><p>Create a new PRNG using the given seed.</p>
  56. <p>PRNG implementations are allowed to assume that bits in the seed are
  57. well distributed. That means usually that the number of one and zero
  58. bits are about equal, and values like 0, 1 and (size - 1) are unlikely.</p>
  59. <p>PRNG implementations are recommended to be reproducible. A PRNG seeded
  60. using this function with a fixed seed should produce the same sequence
  61. of output in the future and on different architectures (with for example
  62. different endianness).</p>
  63. <p>It is however not required that this function yield the same state as a
  64. reference implementation of the PRNG given equivalent seed; if necessary
  65. another constructor replicating behaviour from a reference
  66. implementation can be added.</p>
  67. <p>PRNG implementations should make sure <code>from_seed</code> never panics. In the
  68. case that some special values (like an all zero seed) are not viable
  69. seeds it is preferable to map these to alternative constant value(s),
  70. for example <code>0xBAD5EEDu32</code> or <code>0x0DDB1A5E5BAD5EEDu64</code> (&quot;odd biases? bad
  71. seed&quot;). This is assuming only a small number of values must be rejected.</p>
  72. </div></div>
  73. <h2 id='provided-methods' class='small-section-header'>
  74. Provided Methods<a href='#provided-methods' class='anchor'></a>
  75. </h2>
  76. <div class='methods'>
  77. <h3 id='method.from_rng' class='method'><span id='from_rng.v' class='invisible'><code>fn <a href='#method.from_rng' class='fnname'>from_rng</a>&lt;R&gt;(rng: R) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="struct" href="../rand/struct.Error.html" title="struct rand::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../rand/trait.RngCore.html" title="trait rand::RngCore">RngCore</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Create a new PRNG seeded from another <code>Rng</code>.</p>
  78. <p>This is the recommended way to initialize PRNGs with fresh entropy. The
  79. <a href="../rand/trait.FromEntropy.html"><code>FromEntropy</code></a> trait provides a convenient <code>from_entropy</code> method
  80. based on <code>from_rng</code>.</p>
  81. <p>Usage of this method is not recommended when reproducibility is required
  82. since implementing PRNGs are not required to fix Endianness and are
  83. allowed to modify implementations in new releases.</p>
  84. <p>It is important to use a good source of randomness to initialize the
  85. PRNG. Cryptographic PRNG may be rendered insecure when seeded from a
  86. non-cryptographic PRNG or with insufficient entropy.
  87. Many non-cryptographic PRNGs will show statistical bias in their first
  88. results if their seed numbers are small or if there is a simple pattern
  89. between them.</p>
  90. <p>Prefer to seed from a strong external entropy source like <a href="../rand/rngs/struct.OsRng.html"><code>OsRng</code></a> or
  91. from a cryptographic PRNG; if creating a new generator for cryptographic
  92. uses you <em>must</em> seed from a strong source.</p>
  93. <p>Seeding a small PRNG from another small PRNG is possible, but
  94. something to be careful with. An extreme example of how this can go
  95. wrong is seeding an Xorshift RNG from another Xorshift RNG, which
  96. will effectively clone the generator. In general seeding from a
  97. generator which is hard to predict is probably okay.</p>
  98. <p>PRNG implementations are allowed to assume that a good RNG is provided
  99. for seeding, and that it is cryptographically secure when appropriate.</p>
  100. </div></div>
  101. <h2 id='foreign-impls' class='small-section-header'>
  102. Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
  103. </h2>
  104. <h3 id='impl-SeedableRng' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;R&gt; <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a> for <a class="struct" href="../rand_core/block/struct.BlockRng.html" title="struct rand_core::block::BlockRng">BlockRng</a>&lt;R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a> + <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>,&nbsp;</span></code><a href='#impl-SeedableRng' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/rand_core/block.rs.html#283-293' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Seed-1' class="type"><span id='Seed.t-1' class='invisible'><code>type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;R as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a></code></span></h4>
  105. <h4 id='method.from_seed' class="method"><span id='from_seed.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_seed' class='fnname'>from_seed</a>(seed: &lt;<a class="struct" href="../rand_core/block/struct.BlockRng.html" title="struct rand_core::block::BlockRng">BlockRng</a>&lt;R&gt; as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>) -&gt; <a class="struct" href="../rand_core/block/struct.BlockRng.html" title="struct rand_core::block::BlockRng">BlockRng</a>&lt;R&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/rand_core/block.rs.html#286-288' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.from_rng-1' class="method"><span id='from_rng.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_rng' class='fnname'>from_rng</a>&lt;S&gt;(rng: S) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../rand_core/block/struct.BlockRng.html" title="struct rand_core::block::BlockRng">BlockRng</a>&lt;R&gt;, <a class="struct" href="../rand/struct.Error.html" title="struct rand::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../rand/trait.RngCore.html" title="trait rand::RngCore">RngCore</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/rand_core/block.rs.html#290-292' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-SeedableRng-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;R&gt; <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a> for <a class="struct" href="../rand_core/block/struct.BlockRng64.html" title="struct rand_core::block::BlockRng64">BlockRng64</a>&lt;R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a> + <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>,&nbsp;</span></code><a href='#impl-SeedableRng-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/rand_core/block.rs.html#490-500' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Seed-2' class="type"><span id='Seed.t-2' class='invisible'><code>type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;R as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a></code></span></h4>
  106. <h4 id='method.from_seed-1' class="method"><span id='from_seed.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_seed' class='fnname'>from_seed</a>(seed: &lt;<a class="struct" href="../rand_core/block/struct.BlockRng64.html" title="struct rand_core::block::BlockRng64">BlockRng64</a>&lt;R&gt; as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>) -&gt; <a class="struct" href="../rand_core/block/struct.BlockRng64.html" title="struct rand_core::block::BlockRng64">BlockRng64</a>&lt;R&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/rand_core/block.rs.html#493-495' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.from_rng-2' class="method"><span id='from_rng.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_rng' class='fnname'>from_rng</a>&lt;S&gt;(rng: S) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../rand_core/block/struct.BlockRng64.html" title="struct rand_core::block::BlockRng64">BlockRng64</a>&lt;R&gt;, <a class="struct" href="../rand/struct.Error.html" title="struct rand::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../rand/trait.RngCore.html" title="trait rand::RngCore">RngCore</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/rand_core/block.rs.html#497-499' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span>
  107. <h2 id='implementors' class='small-section-header'>
  108. Implementors<a href='#implementors' class='anchor'></a>
  109. </h2>
  110. <ul class='item-list' id='implementors-list'>
  111. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/chacha/struct.ChaChaRng.html" title="struct rand::prng::chacha::ChaChaRng">ChaChaRng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;<a class="struct" href="../rand/prng/chacha/struct.ChaChaCore.html" title="struct rand::prng::chacha::ChaChaCore">ChaChaCore</a> as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/chacha.rs.html#95-105' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  112. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/chacha/struct.ChaChaCore.html" title="struct rand::prng::chacha::ChaChaCore">ChaChaCore</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 32]</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/chacha.rs.html#274-287' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  113. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/hc128/struct.Hc128Rng.html" title="struct rand::prng::hc128::Hc128Rng">Hc128Rng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;<a class="struct" href="../rand/prng/hc128/struct.Hc128Core.html" title="struct rand::prng::hc128::Hc128Core">Hc128Core</a> as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/hc128.rs.html#94-104' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  114. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/hc128/struct.Hc128Core.html" title="struct rand::prng::hc128::Hc128Core">Hc128Core</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 32]</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/hc128.rs.html#322-333' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  115. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/isaac/struct.IsaacRng.html" title="struct rand::prng::isaac::IsaacRng">IsaacRng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;<a class="struct" href="../rand/prng/isaac/struct.IsaacCore.html" title="struct rand::prng::isaac::IsaacCore">IsaacCore</a> as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/isaac.rs.html#117-127' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  116. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/isaac/struct.IsaacCore.html" title="struct rand::prng::isaac::IsaacCore">IsaacCore</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 32]</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/isaac.rs.html#332-362' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  117. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/isaac64/struct.Isaac64Rng.html" title="struct rand::prng::isaac64::Isaac64Rng">Isaac64Rng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;<a class="struct" href="../rand/prng/isaac64/struct.Isaac64Core.html" title="struct rand::prng::isaac64::Isaac64Core">Isaac64Core</a> as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/isaac64.rs.html#107-117' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  118. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/isaac64/struct.Isaac64Core.html" title="struct rand::prng::isaac64::Isaac64Core">Isaac64Core</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 32]</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/isaac64.rs.html#296-325' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  119. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/prng/struct.XorShiftRng.html" title="struct rand::prng::XorShiftRng">XorShiftRng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 16]</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/prng/xorshift.rs.html#88-129' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  120. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/rngs/struct.SmallRng.html" title="struct rand::rngs::SmallRng">SmallRng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;<a class="struct" href="../rand/prng/struct.XorShiftRng.html" title="struct rand::prng::XorShiftRng">XorShiftRng</a> as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/rngs/small.rs.html#91-101' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  121. <li><table class='table-display'><tbody><tr><td><code>impl SeedableRng for <a class="struct" href="../rand/rngs/struct.StdRng.html" title="struct rand::rngs::StdRng">StdRng</a><span class="where fmt-newline"> type <a href='#associatedtype.Seed' class="type">Seed</a> = &lt;<a class="struct" href="../rand/prng/hc128/struct.Hc128Rng.html" title="struct rand::prng::hc128::Hc128Rng">Hc128Rng</a> as <a class="trait" href="../rand/trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>&gt;::<a class="type" href="../rand/trait.SeedableRng.html#associatedtype.Seed" title="type rand::SeedableRng::Seed">Seed</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../src/rand/rngs/std.rs.html#53-63' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
  122. </ul><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
  123. src="../implementors/rand_core/trait.SeedableRng.js">
  124. </script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "rand";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>