-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7fb751e
Showing
109 changed files
with
9,214 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
window.ALL_CRATES = ["rand_core","rand_mt"]; | ||
//{"start":21,"fragment_lengths":[11,10]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="./static.files/${f}">`).join(""))</script><link rel="stylesheet" href="./static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="./static.files/rustdoc-9d5ec5f3536319c6.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="rand_mt" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (6c6d21008 2024-09-22)" data-channel="nightly" data-search-js="search-0cfde64e8ad3a7fe.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="./static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="./static.files/main-2a73ac97dd39bfde.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-40f72c9259523cb3.css"></noscript><link rel="alternate icon" type="image/png" href="./static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="./static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod sys"><!--[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" title="show sidebar"></button><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2><a href="./index.html">Rustdoc</a><span class="version">1.83.0-nightly</span></h2></div><div class="version">(6c6d21008 2024-09-22)</div><h2 class="location">Help</h2><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Rustdoc help</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section><p>You need to enable JavaScript to use keyboard commands or search.</p><p>For more information, browse the <a href="https://doc.rust-lang.org/rustdoc/">rustdoc handbook</a>.</p></section></noscript></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-9d5ec5f3536319c6.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rand_core" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (6c6d21008 2024-09-22)" data-channel="nightly" data-search-js="search-0cfde64e8ad3a7fe.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="../static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="../static.files/main-2a73ac97dd39bfde.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-40f72c9259523cb3.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc mod sys"><!--[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" title="show sidebar"></button><a class="logo-container" href="../rand_core/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../rand_core/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../rand_core/index.html">rand_<wbr>core</a><span class="version">0.6.4</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.Error.html">Error</a></li><li><a href="block/struct.BlockRng.html">block::BlockRng</a></li><li><a href="block/struct.BlockRng64.html">block::BlockRng64</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="trait.CryptoRng.html">CryptoRng</a></li><li><a href="trait.CryptoRngCore.html">CryptoRngCore</a></li><li><a href="trait.RngCore.html">RngCore</a></li><li><a href="trait.SeedableRng.html">SeedableRng</a></li><li><a href="block/trait.BlockRngCore.html">block::BlockRngCore</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="impls/fn.fill_bytes_via_next.html">impls::fill_bytes_via_next</a></li><li><a href="impls/fn.fill_via_u32_chunks.html">impls::fill_via_u32_chunks</a></li><li><a href="impls/fn.fill_via_u64_chunks.html">impls::fill_via_u64_chunks</a></li><li><a href="impls/fn.next_u32_via_fill.html">impls::next_u32_via_fill</a></li><li><a href="impls/fn.next_u64_via_fill.html">impls::next_u64_via_fill</a></li><li><a href="impls/fn.next_u64_via_u32.html">impls::next_u64_via_u32</a></li><li><a href="le/fn.read_u32_into.html">le::read_u32_into</a></li><li><a href="le/fn.read_u64_into.html">le::read_u64_into</a></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!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 `BlockRngCore` trait and implementation helpers"><title>rand_core::block - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-9d5ec5f3536319c6.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rand_core" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (6c6d21008 2024-09-22)" data-channel="nightly" data-search-js="search-0cfde64e8ad3a7fe.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="../../static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-2a73ac97dd39bfde.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-40f72c9259523cb3.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc mod"><!--[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" title="show sidebar"></button><a class="logo-container" href="../../rand_core/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../rand_core/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../rand_core/index.html">rand_<wbr>core</a><span class="version">0.6.4</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module block</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate rand_<wbr>core</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">rand_core</a>::<wbr><a class="mod" href="#">block</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/rand_core/block.rs.html#9-539">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>BlockRngCore</code> trait and implementation helpers</p> | ||
<p>The <a href="trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore"><code>BlockRngCore</code></a> trait exists to assist in the implementation of RNGs | ||
which generate a block of data in a cache instead of returning generated | ||
values directly.</p> | ||
<p>Usage of this trait is optional, but provides two advantages: | ||
implementations only need to concern themselves with generation of the | ||
block, not the various <a href="../trait.RngCore.html" title="trait rand_core::RngCore"><code>RngCore</code></a> methods (especially <a href="../trait.RngCore.html#tymethod.fill_bytes" title="method rand_core::RngCore::fill_bytes"><code>fill_bytes</code></a>, where | ||
the optimal implementations are not trivial), and this allows | ||
<code>ReseedingRng</code> (see <a href="https://docs.rs/rand"><code>rand</code></a> crate) perform periodic | ||
reseeding with very low overhead.</p> | ||
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand_core::{RngCore, SeedableRng}; | ||
<span class="kw">use </span>rand_core::block::{BlockRngCore, BlockRng}; | ||
|
||
<span class="kw">struct </span>MyRngCore; | ||
|
||
<span class="kw">impl </span>BlockRngCore <span class="kw">for </span>MyRngCore { | ||
<span class="kw">type </span>Item = u32; | ||
<span class="kw">type </span>Results = [u32; <span class="number">16</span>]; | ||
|
||
<span class="kw">fn </span>generate(<span class="kw-2">&mut </span><span class="self">self</span>, results: <span class="kw-2">&mut </span><span class="self">Self</span>::Results) { | ||
<span class="macro">unimplemented!</span>() | ||
} | ||
} | ||
|
||
<span class="kw">impl </span>SeedableRng <span class="kw">for </span>MyRngCore { | ||
<span class="kw">type </span>Seed = [u8; <span class="number">32</span>]; | ||
<span class="kw">fn </span>from_seed(seed: <span class="self">Self</span>::Seed) -> <span class="self">Self </span>{ | ||
<span class="macro">unimplemented!</span>() | ||
} | ||
} | ||
|
||
<span class="comment">// optionally, also implement CryptoRng for MyRngCore | ||
|
||
// Final RNG. | ||
</span><span class="kw">let </span><span class="kw-2">mut </span>rng = BlockRng::<MyRngCore>::seed_from_u64(<span class="number">0</span>); | ||
<span class="macro">println!</span>(<span class="string">"First value: {}"</span>, rng.next_u32());</code></pre></div> | ||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.BlockRng.html" title="struct rand_core::block::BlockRng">Block<wbr>Rng</a></div><div class="desc docblock-short">A wrapper type implementing <a href="../trait.RngCore.html" title="trait rand_core::RngCore"><code>RngCore</code></a> for some type implementing | ||
<a href="trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore"><code>BlockRngCore</code></a> with <code>u32</code> array buffer; i.e. this can be used to implement | ||
a full RNG from just a <code>generate</code> function.</div></li><li><div class="item-name"><a class="struct" href="struct.BlockRng64.html" title="struct rand_core::block::BlockRng64">Block<wbr>Rng64</a></div><div class="desc docblock-short">A wrapper type implementing <a href="../trait.RngCore.html" title="trait rand_core::RngCore"><code>RngCore</code></a> for some type implementing | ||
<a href="trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore"><code>BlockRngCore</code></a> with <code>u64</code> array buffer; i.e. this can be used to implement | ||
a full RNG from just a <code>generate</code> function.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore">Block<wbr>RngCore</a></div><div class="desc docblock-short">A trait for RNGs which do not generate random numbers individually, but in | ||
blocks (typically <code>[u32; N]</code>). This technique is commonly used by | ||
cryptographic RNGs to improve performance.</div></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.SIDEBAR_ITEMS = {"struct":["BlockRng","BlockRng64"],"trait":["BlockRngCore"]}; |
Oops, something went wrong.