forked from diesel-rs/diesel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrait.RngCore.html
More file actions
126 lines (120 loc) · 54.7 KB
/
Copy pathtrait.RngCore.html
File metadata and controls
126 lines (120 loc) · 54.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!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="The core of a random number generator."><meta name="keywords" content="rust, rustlang, rust-lang, RngCore"><title>RngCore in rand - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../rand/index.html"><div class="logo-container"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></div>
</a><h2 class="location"></h2>
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../rand/index.html"><div class="logo-container">
<img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></div>
</a><h2 class="location"><a href="#">RngCore</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.fill_bytes">fill_bytes</a></li><li><a href="#tymethod.next_u32">next_u32</a></li><li><a href="#tymethod.next_u64">next_u64</a></li><li><a href="#tymethod.try_fill_bytes">try_fill_bytes</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul><li><a href="#impl-RngCore-for-%26%27a%20mut%20R">&'a mut R</a></li><li><a href="#impl-RngCore-for-Box%3CR%2C%20Global%3E">Box<R, Global></a></li><li><a href="#impl-RngCore-for-ChaCha12Rng">ChaCha12Rng</a></li><li><a href="#impl-RngCore-for-ChaCha20Rng">ChaCha20Rng</a></li><li><a href="#impl-RngCore-for-ChaCha8Rng">ChaCha8Rng</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Read">Read</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In rand</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../rand/index.html">
<img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1">
<a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div>
</div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Trait <a href="index.html">rand</a>::<wbr><a class="trait" href="#">RngCore</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/rand_core/lib.rs.html#142">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait RngCore {
fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]);
<span class="item-spacer"></span> fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>>;
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The core of a random number generator.</p>
<p>This trait encapsulates the low-level functionality common to all
generators, and is the “back end”, to be implemented by generators.
End users should normally use the <code>Rng</code> trait from the <a href="https://docs.rs/rand"><code>rand</code></a> crate,
which is automatically implemented for every type implementing <code>RngCore</code>.</p>
<p>Three different methods for generating random data are provided since the
optimal implementation of each is dependent on the type of generator. There
is no required relationship between the output of each; e.g. many
implementations of <a href="trait.RngCore.html#tymethod.fill_bytes"><code>fill_bytes</code></a> consume a whole number of <code>u32</code> or <code>u64</code>
values and drop any remaining unused bytes. The same can happen with the
<a href="trait.RngCore.html#tymethod.next_u32"><code>next_u32</code></a> and <a href="trait.RngCore.html#tymethod.next_u64"><code>next_u64</code></a> methods, implementations may discard some
random bits for efficiency.</p>
<p>The <a href="trait.RngCore.html#tymethod.try_fill_bytes"><code>try_fill_bytes</code></a> method is a variant of <a href="trait.RngCore.html#tymethod.fill_bytes"><code>fill_bytes</code></a> allowing error
handling; it is not deemed sufficiently useful to add equivalents for
<a href="trait.RngCore.html#tymethod.next_u32"><code>next_u32</code></a> or <a href="trait.RngCore.html#tymethod.next_u64"><code>next_u64</code></a> since the latter methods are almost always used
with algorithmic generators (PRNGs), which are normally infallible.</p>
<p>Implementers should produce bits uniformly. Pathological RNGs (e.g. always
returning the same value, or never setting certain bits) can break rejection
sampling used by random distributions, and also break other RNGs when
seeding them via <a href="trait.SeedableRng.html#method.from_rng" title="SeedableRng::from_rng"><code>SeedableRng::from_rng</code></a>.</p>
<p>Algorithmic generators implementing <a href="trait.SeedableRng.html" title="SeedableRng"><code>SeedableRng</code></a> should normally have
<em>portable, reproducible</em> output, i.e. fix Endianness when converting values
to avoid platform differences, and avoid making any changes which affect
output (except by communicating that the release has breaking changes).</p>
<p>Typically an RNG will implement only one of the methods available
in this trait directly, then use the helper functions from the
<a href="../rand_core/impls/index.html" title="impls"><code>impls</code></a> module to implement the other methods.</p>
<p>It is recommended that implementations also implement:</p>
<ul>
<li><code>Debug</code> with a custom implementation which <em>does not</em> print any internal
state (at least, <a href="trait.CryptoRng.html" title="CryptoRng"><code>CryptoRng</code></a>s should not risk leaking state through
<code>Debug</code>).</li>
<li><code>Serialize</code> and <code>Deserialize</code> (from Serde), preferably making Serde
support optional at the crate level in PRNG libs.</li>
<li><code>Clone</code>, if possible.</li>
<li><em>never</em> implement <code>Copy</code> (accidental copies may cause repeated values).</li>
<li><em>do not</em> implement <code>Default</code> for pseudorandom generators, but instead
implement <a href="trait.SeedableRng.html" title="SeedableRng"><code>SeedableRng</code></a>, to guide users towards proper seeding.
External / hardware RNGs can choose to implement <code>Default</code>.</li>
<li><code>Eq</code> and <code>PartialEq</code> could be implemented, but are probably not useful.</li>
</ul>
<h2 id="example"><a href="#example">Example</a></h2>
<p>A simple example, obviously not generating very <em>random</em> output:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#![<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
<span class="kw">use</span> <span class="ident">rand_core</span>::{<span class="ident">RngCore</span>, <span class="ident">Error</span>, <span class="ident">impls</span>};
<span class="kw">struct</span> <span class="ident">CountingRng</span>(<span class="ident">u64</span>);
<span class="kw">impl</span> <span class="ident">RngCore</span> <span class="kw">for</span> <span class="ident">CountingRng</span> {
<span class="kw">fn</span> <span class="ident">next_u32</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="ident">u32</span> {
<span class="self">self</span>.<span class="ident">next_u64</span>() <span class="kw">as</span> <span class="ident">u32</span>
}
<span class="kw">fn</span> <span class="ident">next_u64</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="ident">u64</span> {
<span class="self">self</span>.<span class="number">0</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
<span class="self">self</span>.<span class="number">0</span>
}
<span class="kw">fn</span> <span class="ident">fill_bytes</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">dest</span>: <span class="kw-2">&mut</span> [<span class="ident">u8</span>]) {
<span class="ident">impls::fill_bytes_via_next</span>(<span class="self">self</span>, <span class="ident">dest</span>)
}
<span class="kw">fn</span> <span class="ident">try_fill_bytes</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">dest</span>: <span class="kw-2">&mut</span> [<span class="ident">u8</span>]) -> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
<span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">fill_bytes</span>(<span class="ident">dest</span>))
}
}</code></pre></div>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.next_u32" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#148">source</a></div><h4 class="code-header">fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Return the next random <code>u32</code>.</p>
<p>RNGs must implement at least one method from this trait directly. In
the case this method is not implemented directly, it can be implemented
using <code>self.next_u64() as u32</code> or via <a href="../rand_core/impls/fn.next_u32_via_fill.html" title="impls::next_u32_via_fill"><code>impls::next_u32_via_fill</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.next_u64" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#155">source</a></div><h4 class="code-header">fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></div></summary><div class="docblock"><p>Return the next random <code>u64</code>.</p>
<p>RNGs must implement at least one method from this trait directly. In
the case this method is not implemented directly, it can be implemented
via <a href="../rand_core/impls/fn.next_u64_via_u32.html" title="impls::next_u64_via_u32"><code>impls::next_u64_via_u32</code></a> or via <a href="../rand_core/impls/fn.next_u64_via_fill.html" title="impls::next_u64_via_fill"><code>impls::next_u64_via_fill</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.fill_bytes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#171">source</a></div><h4 class="code-header">fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></div></summary><div class="docblock"><p>Fill <code>dest</code> with random data.</p>
<p>RNGs must implement at least one method from this trait directly. In
the case this method is not implemented directly, it can be implemented
via <a href="../rand_core/impls/fn.fill_bytes_via_next.html" title="impls::fill_bytes_via_next"><code>impls::fill_bytes_via_next</code></a> or
via <a href="trait.RngCore.html#tymethod.try_fill_bytes" title="RngCore::try_fill_bytes"><code>RngCore::try_fill_bytes</code></a>; if this generator can
fail the implementation must choose how best to handle errors here
(e.g. panic with a descriptive message or log a warning and retry a few
times).</p>
<p>This method should guarantee that <code>dest</code> is entirely filled
with new data, and may panic if this is impossible
(e.g. reading past the end of a file that is being used as the
source of randomness).</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_fill_bytes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#184">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>></h4></div></summary><div class="docblock"><p>Fill <code>dest</code> entirely with random data.</p>
<p>This is the only method which allows an RNG to report errors while
generating random data thus making this the primary method implemented
by external (true) RNGs (e.g. <code>OsRng</code>) which can fail. It may be used
directly to generate keys and to seed (infallible) PRNGs.</p>
<p>Other than error handling, this method is identical to <a href="trait.RngCore.html#tymethod.fill_bytes" title="RngCore::fill_bytes"><code>RngCore::fill_bytes</code></a>;
thus this may be implemented using <code>Ok(self.fill_bytes(dest))</code> or
<code>fill_bytes</code> may be implemented with
<code>self.try_fill_bytes(dest).unwrap()</code> or more specific error handling.</p>
</div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Read" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#444">source</a></span><a href="#impl-Read" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for dyn <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + 'static</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#445">source</a></span><a href="#method.read" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read" class="fnname">read</a>(&mut self, buf: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class='docblock'><p>Pull some bytes from this source into the specified buffer, returning
how many bytes were read. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_vectored" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#638">source</a></span><a href="#method.read_vectored" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_vectored" class="fnname">read_vectored</a>(&mut self, bufs: &mut [<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSliceMut.html" title="struct std::io::IoSliceMut">IoSliceMut</a><'_>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class='docblock'><p>Like <code>read</code>, except that it reads into a slice of buffers. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_vectored">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_read_vectored" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#651">source</a></span><a href="#method.is_read_vectored" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.is_read_vectored" class="fnname">is_read_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>can_vector</code>)</div></span><div class='docblock'><p>Determines if this <code>Read</code>er has an efficient <code>read_vectored</code>
implementation. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.is_read_vectored">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_to_end" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#702">source</a></span><a href="#method.read_to_end" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end" class="fnname">read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class='docblock'><p>Read all bytes until EOF in this source, placing them into <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_to_string" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#745">source</a></span><a href="#method.read_to_string" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string" class="fnname">read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class='docblock'><p>Read all bytes until EOF in this source, appending them to <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_exact" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#800">source</a></span><a href="#method.read_exact" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact" class="fnname">read_exact</a>(&mut self, buf: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class='docblock'><p>Read the exact number of bytes required to fill <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_buf" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#811">source</a></span><a href="#method.read_buf" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_buf" class="fnname">read_buf</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/readbuf/struct.ReadBuf.html" title="struct std::io::readbuf::ReadBuf">ReadBuf</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>read_buf</code>)</div></span><div class='docblock'><p>Pull some bytes from this source into the specified buffer. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_buf">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_buf_exact" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#820">source</a></span><a href="#method.read_buf_exact" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_buf_exact" class="fnname">read_buf_exact</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/readbuf/struct.ReadBuf.html" title="struct std::io::readbuf::ReadBuf">ReadBuf</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>read_buf</code>)</div></span><div class='docblock'><p>Read the exact number of bytes required to fill <code>buf</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_buf_exact">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.by_ref" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#872-874">source</a></span><a href="#method.by_ref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</h4></section></summary><div class='docblock'><p>Creates a “by reference” adaptor for this instance of <code>Read</code>. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.by_ref">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bytes" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#910-912">source</a></span><a href="#method.bytes" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.bytes" class="fnname">bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self></h4></section></summary><div class='docblock'><p>Transforms this <code>Read</code> instance to an <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> over its bytes. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.bytes">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.chain" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#948-950">source</a></span><a href="#method.chain" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chain" class="fnname">chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a>, </span></h4></section></summary><div class='docblock'><p>Creates an adapter which will chain this stream with another. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chain">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#987-989">source</a></span><a href="#method.take" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.take" class="fnname">take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></h4></section></summary><div class='docblock'><p>Creates an adapter which will read at most <code>limit</code> bytes from it. <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.take">Read more</a></p>
</div></details></div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-RngCore-for-Box%3CR%2C%20Global%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#421">source</a></span><a href="#impl-RngCore-for-Box%3CR%2C%20Global%3E" class="anchor"></a><h3 class="code-header in-band">impl<R> <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><R, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>> <span class="where fmt-newline">where<br> R: <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><section id="method.next_u32" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#423">source</a></span><a href="#method.next_u32" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section><section id="method.next_u64" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#428">source</a></span><a href="#method.next_u64" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section><section id="method.fill_bytes" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#433">source</a></span><a href="#method.fill_bytes" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section><section id="method.try_fill_bytes" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#438">source</a></span><a href="#method.try_fill_bytes" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-RngCore-for-%26%27a%20mut%20R" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#395">source</a></span><a href="#impl-RngCore-for-%26%27a%20mut%20R" class="anchor"></a><h3 class="code-header in-band">impl<'a, R> <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><section id="method.next_u32-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#397">source</a></span><a href="#method.next_u32-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section><section id="method.next_u64-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#402">source</a></span><a href="#method.next_u64-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section><section id="method.fill_bytes-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#407">source</a></span><a href="#method.fill_bytes-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section><section id="method.try_fill_bytes-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/lib.rs.html#412">source</a></span><a href="#method.try_fill_bytes-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, dest: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-RngCore-for-ChaCha8Rng" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#345">source</a></span><a href="#impl-RngCore-for-ChaCha8Rng" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="../rand_chacha/chacha/struct.ChaCha8Rng.html" title="struct rand_chacha::chacha::ChaCha8Rng">ChaCha8Rng</a></h3></section></summary><div class="impl-items"><section id="method.next_u32-2" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#345">source</a></span><a href="#method.next_u32-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section><section id="method.next_u64-2" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#345">source</a></span><a href="#method.next_u64-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section><section id="method.fill_bytes-2" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#345">source</a></span><a href="#method.fill_bytes-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, bytes: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section><section id="method.try_fill_bytes-2" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#345">source</a></span><a href="#method.try_fill_bytes-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, bytes: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-RngCore-for-ChaCha20Rng" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#343">source</a></span><a href="#impl-RngCore-for-ChaCha20Rng" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="../rand_chacha/chacha/struct.ChaCha20Rng.html" title="struct rand_chacha::chacha::ChaCha20Rng">ChaCha20Rng</a></h3></section></summary><div class="impl-items"><section id="method.next_u32-3" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#343">source</a></span><a href="#method.next_u32-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section><section id="method.next_u64-3" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#343">source</a></span><a href="#method.next_u64-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section><section id="method.fill_bytes-3" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#343">source</a></span><a href="#method.fill_bytes-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, bytes: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section><section id="method.try_fill_bytes-3" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#343">source</a></span><a href="#method.try_fill_bytes-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, bytes: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-RngCore-for-ChaCha12Rng" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#344">source</a></span><a href="#impl-RngCore-for-ChaCha12Rng" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="../rand_chacha/chacha/struct.ChaCha12Rng.html" title="struct rand_chacha::chacha::ChaCha12Rng">ChaCha12Rng</a></h3></section></summary><div class="impl-items"><section id="method.next_u32-4" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#344">source</a></span><a href="#method.next_u32-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u32" class="fnname">next_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section><section id="method.next_u64-4" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#344">source</a></span><a href="#method.next_u64-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.next_u64" class="fnname">next_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section><section id="method.fill_bytes-4" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#344">source</a></span><a href="#method.fill_bytes-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.fill_bytes" class="fnname">fill_bytes</a>(&mut self, bytes: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section><section id="method.try_fill_bytes-4" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_chacha/chacha.rs.html#344">source</a></span><a href="#method.try_fill_bytes-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.try_fill_bytes" class="fnname">try_fill_bytes</a>(&mut self, bytes: &mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct rand::Error">Error</a>></h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-RngCore" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand/rngs/mock.rs.html#48-71">source</a></span><a href="#impl-RngCore" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/mock/struct.StepRng.html" title="struct rand::rngs::mock::StepRng">StepRng</a></h3></section><section id="impl-RngCore-1" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/os.rs.html#52">source</a></span><a href="#impl-RngCore-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/struct.OsRng.html" title="struct rand::rngs::OsRng">OsRng</a></h3></section><section id="impl-RngCore-2" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand/rngs/small.rs.html#83-103">source</a></span><a href="#impl-RngCore-2" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/struct.SmallRng.html" title="struct rand::rngs::SmallRng">SmallRng</a></h3></section><section id="impl-RngCore-3" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand/rngs/std.rs.html#36-56">source</a></span><a href="#impl-RngCore-3" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/struct.StdRng.html" title="struct rand::rngs::StdRng">StdRng</a></h3></section><section id="impl-RngCore-4" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand/rngs/thread.rs.html#99-129">source</a></span><a href="#impl-RngCore-4" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng">ThreadRng</a></h3></section><section id="impl-RngCore-5" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/block.rs.html#349">source</a></span><a href="#impl-RngCore-5" class="anchor"></a><h3 class="code-header in-band">impl<R> <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="../rand_core/block/struct.BlockRng64.html" title="struct rand_core::block::BlockRng64">BlockRng64</a><R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>>,<br> <R as <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a>>::<a class="associatedtype" href="../rand_core/block/trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>]>,<br> <R as <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a>>::<a class="associatedtype" href="../rand_core/block/trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>]>, </span></h3></section><section id="impl-RngCore-6" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand_core/block.rs.html#181">source</a></span><a href="#impl-RngCore-6" class="anchor"></a><h3 class="code-header in-band">impl<R> <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="../rand_core/block/struct.BlockRng.html" title="struct rand_core::block::BlockRng">BlockRng</a><R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,<br> <R as <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a>>::<a class="associatedtype" href="../rand_core/block/trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>]>,<br> <R as <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a>>::<a class="associatedtype" href="../rand_core/block/trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>]>, </span></h3></section><section id="impl-RngCore-7" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand/rngs/adapter/reseeding.rs.html#113-135">source</a></span><a href="#impl-RngCore-7" class="anchor"></a><h3 class="code-header in-band">impl<R, Rsdr: <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a>> <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/adapter/struct.ReseedingRng.html" title="struct rand::rngs::adapter::ReseedingRng">ReseedingRng</a><R, Rsdr> <span class="where fmt-newline">where<br> R: <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>> + <a class="trait" href="trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>,<br> <R as <a class="trait" href="../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">BlockRngCore</a>>::<a class="associatedtype" href="../rand_core/block/trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>]> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>]>, </span></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>std</code></strong> only.</div></span></section><section id="impl-RngCore-8" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/rand/rngs/adapter/read.rs.html#50-77">source</a></span><a href="#impl-RngCore-8" class="anchor"></a><h3 class="code-header in-band">impl<R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a>> <a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a> for <a class="struct" href="rngs/adapter/struct.ReadRng.html" title="struct rand::rngs::adapter::ReadRng">ReadRng</a><R></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>std</code></strong> only.</div></span></section></div><script type="text/javascript" src="../implementors/rand_core/trait.RngCore.js" data-ignore-extern-crates="rand_core,alloc,rand_chacha" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="rand" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0-nightly (495b21669 2022-07-03)" ></div>
</body></html>