mpvrc/rand_core/block/trait.BlockRngCore.html

15 lines
No EOL
7.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="A trait for RNGs which do not generate random numbers individually, but in blocks (typically `[u32; N]`). This technique is commonly used by cryptographic RNGs to improve performance."><title>BlockRngCore in rand_core::block - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.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.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.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" 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="#">Block<wbr>RngCore</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Item" title="Item">Item</a></li><li><a href="#associatedtype.Results" title="Results">Results</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.generate" title="generate">generate</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In rand_<wbr>core::<wbr>block</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"><span class="rustdoc-breadcrumbs"><a href="../index.html">rand_core</a>::<wbr><a href="index.html">block</a></span><h1>Trait <span class="trait">BlockRngCore</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/rand_core/block.rs.html#68-78">Source</a> </span></div><pre class="rust item-decl"><code>pub trait BlockRngCore {
type <a href="#associatedtype.Item" class="associatedtype">Item</a>;
type <a href="#associatedtype.Results" class="associatedtype">Results</a>: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[Self::<a class="associatedtype" href="trait.BlockRngCore.html#associatedtype.Item" title="type rand_core::block::BlockRngCore::Item">Item</a>]&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a>&lt;[Self::<a class="associatedtype" href="trait.BlockRngCore.html#associatedtype.Item" title="type rand_core::block::BlockRngCore::Item">Item</a>]&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a>;
// Required method
fn <a href="#tymethod.generate" class="fn">generate</a>(&amp;mut self, results: &amp;mut Self::<a class="associatedtype" href="trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>);
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>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.</p>
<p>See the <a href="index.html" title="mod rand_core::block">module</a> documentation for details.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Item" class="method"><a class="src rightside" href="../../src/rand_core/block.rs.html#70">Source</a><h4 class="code-header">type <a href="#associatedtype.Item" class="associatedtype">Item</a></h4></section></summary><div class="docblock"><p>Results element type, e.g. <code>u32</code>.</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Results" class="method"><a class="src rightside" href="../../src/rand_core/block.rs.html#74">Source</a><h4 class="code-header">type <a href="#associatedtype.Results" class="associatedtype">Results</a>: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[Self::<a class="associatedtype" href="trait.BlockRngCore.html#associatedtype.Item" title="type rand_core::block::BlockRngCore::Item">Item</a>]&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a>&lt;[Self::<a class="associatedtype" href="trait.BlockRngCore.html#associatedtype.Item" title="type rand_core::block::BlockRngCore::Item">Item</a>]&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a></h4></section></summary><div class="docblock"><p>Results type. This is the block an RNG implementing <code>BlockRngCore</code>
generates, which will usually be an array like <code>[u32; 16]</code>.</p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.generate" class="method"><a class="src rightside" href="../../src/rand_core/block.rs.html#77">Source</a><h4 class="code-header">fn <a href="#tymethod.generate" class="fn">generate</a>(&amp;mut self, results: &amp;mut Self::<a class="associatedtype" href="trait.BlockRngCore.html#associatedtype.Results" title="type rand_core::block::BlockRngCore::Results">Results</a>)</h4></section></summary><div class="docblock"><p>Generate a new block of results.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/rand_core/block/trait.BlockRngCore.js" async></script></section></div></main></body></html>