blob: 49e6528d89103f5ff57292a971f19fda226963f2 [file] [log] [blame]
<!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="Helper trait handling actual uniform sampling."><meta name="keywords" content="rust, rustlang, rust-lang, UniformSampler"><title>UniformSampler in rand_distr::uniform - 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 src="../../crates.js"></script><script defer src="../../main.js"></script>
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="https:&#x2F;&#x2F;www.rust-lang.org&#x2F;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="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a class="sidebar-logo" href="../../rand_distr/index.html"><div class="logo-container"><img src="https:&#x2F;&#x2F;www.rust-lang.org&#x2F;logos&#x2F;rust-logo-128x128-blk.png" alt="logo"></div>
</a><h2 class="location">Trait UniformSampler</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><div class="sidebar-links"><a href="#associatedtype.X">X</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.new">new</a><a href="#tymethod.new_inclusive">new_inclusive</a><a href="#tymethod.sample">sample</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.sample_single">sample_single</a><a href="#method.sample_single_inclusive">sample_single_inclusive</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../index.html">rand_distr</a>::<wbr><a href="index.html">uniform</a></h2><div id="sidebar-vars" data-name="UniformSampler" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../rand_distr/index.html"><img src="https:&#x2F;&#x2F;www.rust-lang.org&#x2F;logos&#x2F;rust-logo-128x128-blk.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></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_distr</a>::<wbr><a href="index.html">uniform</a>::<wbr><a class="trait" href="#">UniformSampler</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/distributions/uniform.rs.html#231-302" title="goto source code">source</a> ·
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div>
<div class="docblock item-decl"><pre class="rust trait"><code>pub trait UniformSampler {
type <a href="#associatedtype.X" class="associatedtype">X</a>;
fn <a href="#tymethod.new" class="fnname">new</a>&lt;B1, B2&gt;(low: B1, high: B2) -&gt; Self<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;</span>;
<div class="item-spacer"></div> fn <a href="#tymethod.new_inclusive" class="fnname">new_inclusive</a>&lt;B1, B2&gt;(low: B1, high: B2) -&gt; Self<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;</span>;
<div class="item-spacer"></div> fn <a href="#tymethod.sample" class="fnname">sample</a>&lt;R&gt;(&amp;self, rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../rand/rng/trait.Rng.html" title="trait rand::rng::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>;
fn <a href="#method.sample_single" class="fnname">sample_single</a>&lt;R, B1, B2&gt;(low: B1, high: B2, rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../rand/rng/trait.Rng.html" title="trait rand::rng::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;</span>,
{ ... }
<div class="item-spacer"></div> fn <a href="#method.sample_single_inclusive" class="fnname">sample_single_inclusive</a>&lt;R, B1, B2&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;low: B1, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;high: B2, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../rand/rng/trait.Rng.html" title="trait rand::rng::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;</span>,
{ ... }
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Helper trait handling actual uniform sampling.</p>
<p>See the <a href="index.html">module documentation</a> on how to implement <a href="../struct.Uniform.html" title="Uniform"><code>Uniform</code></a> range
sampling for a custom type.</p>
<p>Implementation of <a href="trait.UniformSampler.html#method.sample_single"><code>sample_single</code></a> is optional, and is only useful when
the implementation can be faster than <code>Self::new(low, high).sample(rng)</code>.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.X" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#233" title="goto source code">source</a></div><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a></h4></div></summary><div class="docblock"><p>The type sampled by this implementation.</p>
</div></details></div><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.new" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#240-243" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#tymethod.new" class="fnname">new</a>&lt;B1, B2&gt;(low: B1, high: B2) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Construct self, with inclusive lower bound and exclusive upper bound
<code>[low, high)</code>.</p>
<p>Usually users should not call this directly but instead use
<code>Uniform::new</code>, which asserts that <code>low &lt; high</code> before calling this.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.new_inclusive" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#250-253" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#tymethod.new_inclusive" class="fnname">new_inclusive</a>&lt;B1, B2&gt;(low: B1, high: B2) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Construct self, with inclusive bounds <code>[low, high]</code>.</p>
<p>Usually users should not call this directly but instead use
<code>Uniform::new_inclusive</code>, which asserts that <code>low &lt;= high</code> before
calling this.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.sample" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#256" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#tymethod.sample" class="fnname">sample</a>&lt;R&gt;(&amp;self, rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../rand/rng/trait.Rng.html" title="trait rand::rng::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Sample a value.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.sample_single" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#277-280" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#method.sample_single" class="fnname">sample_single</a>&lt;R, B1, B2&gt;(low: B1, high: B2, rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../rand/rng/trait.Rng.html" title="trait rand::rng::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Sample a single value uniformly from a range with inclusive lower bound
and exclusive upper bound <code>[low, high)</code>.</p>
<p>By default this is implemented using
<code>UniformSampler::new(low, high).sample(rng)</code>. However, for some types
more optimal implementations for single usage may be provided via this
method (which is the case for integers and floats).
Results may not be identical.</p>
<p>Note that to use this method in a generic context, the type needs to be
retrieved via <code>SampleUniform::Sampler</code> as follows:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">rand</span>::{<span class="ident">thread_rng</span>, <span class="ident">distributions::uniform</span>::{<span class="ident">SampleUniform</span>, <span class="ident">UniformSampler</span>}};
<span class="kw">fn</span> <span class="ident">sample_from_range</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">SampleUniform</span><span class="op">&gt;</span>(<span class="ident">lb</span>: <span class="ident">T</span>, <span class="ident">ub</span>: <span class="ident">T</span>) -&gt; <span class="ident">T</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">thread_rng</span>();
<span class="op">&lt;</span><span class="ident">T</span> <span class="kw">as</span> <span class="ident">SampleUniform</span><span class="op">&gt;</span><span class="ident">::Sampler::sample_single</span>(<span class="ident">lb</span>, <span class="ident">ub</span>, <span class="kw-2">&amp;mut</span> <span class="ident">rng</span>)
}</code></pre></div>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.sample_single_inclusive" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#294-297" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#method.sample_single_inclusive" class="fnname">sample_single_inclusive</a>&lt;R, B1, B2&gt;(low: B1, high: B2, rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../rand/rng/trait.Rng.html" title="trait rand::rng::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B1: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;B2: <a class="trait" href="trait.SampleBorrow.html" title="trait rand_distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Self::<a class="associatedtype" href="trait.UniformSampler.html#associatedtype.X" title="type rand_distr::uniform::UniformSampler::X">X</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Sample a single value uniformly from a range with inclusive lower bound
and inclusive upper bound <code>[low, high]</code>.</p>
<p>By default this is implemented using
<code>UniformSampler::new_inclusive(low, high).sample(rng)</code>. However, for
some types more optimal implementations for single usage may be provided
via this method.
Results may not be identical.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#749-788" title="goto source code">source</a></div><a href="#impl-UniformSampler" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformChar.html" title="struct rand_distr::uniform::UniformChar">UniformChar</a></h3></div></summary><div class="impl-items"><div id="associatedtype.X-1" class="type trait-impl has-srclink"><a href="#associatedtype.X-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#1050-1148" title="goto source code">source</a></div><a href="#impl-UniformSampler-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformDuration.html" title="struct rand_distr::uniform::UniformDuration">UniformDuration</a></h3></div></summary><div class="impl-items"><div id="associatedtype.X-2" class="type trait-impl has-srclink"><a href="#associatedtype.X-2" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-2" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#998" title="goto source code">source</a></div><a href="#impl-UniformSampler-2" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformFloat.html" title="struct rand_distr::uniform::UniformFloat">UniformFloat</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-3" class="type trait-impl has-srclink"><a href="#associatedtype.X-3" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-3" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#999" title="goto source code">source</a></div><a href="#impl-UniformSampler-3" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformFloat.html" title="struct rand_distr::uniform::UniformFloat">UniformFloat</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-4" class="type trait-impl has-srclink"><a href="#associatedtype.X-4" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-4" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#559" title="goto source code">source</a></div><a href="#impl-UniformSampler-4" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-5" class="type trait-impl has-srclink"><a href="#associatedtype.X-5" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-5" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#560" title="goto source code">source</a></div><a href="#impl-UniformSampler-5" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-6" class="type trait-impl has-srclink"><a href="#associatedtype.X-6" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-6" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#561" title="goto source code">source</a></div><a href="#impl-UniformSampler-6" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-7" class="type trait-impl has-srclink"><a href="#associatedtype.X-7" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-7" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#562" title="goto source code">source</a></div><a href="#impl-UniformSampler-7" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-8" class="type trait-impl has-srclink"><a href="#associatedtype.X-8" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-8" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#563" title="goto source code">source</a></div><a href="#impl-UniformSampler-8" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i128.html">i128</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-9" class="type trait-impl has-srclink"><a href="#associatedtype.X-9" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i128.html">i128</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-9" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#564" title="goto source code">source</a></div><a href="#impl-UniformSampler-9" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-10" class="type trait-impl has-srclink"><a href="#associatedtype.X-10" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-10" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#565" title="goto source code">source</a></div><a href="#impl-UniformSampler-10" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-11" class="type trait-impl has-srclink"><a href="#associatedtype.X-11" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-11" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#566" title="goto source code">source</a></div><a href="#impl-UniformSampler-11" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-12" class="type trait-impl has-srclink"><a href="#associatedtype.X-12" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-12" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#567" title="goto source code">source</a></div><a href="#impl-UniformSampler-12" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-13" class="type trait-impl has-srclink"><a href="#associatedtype.X-13" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-13" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#568" title="goto source code">source</a></div><a href="#impl-UniformSampler-13" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-14" class="type trait-impl has-srclink"><a href="#associatedtype.X-14" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-14" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#570" title="goto source code">source</a></div><a href="#impl-UniformSampler-14" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u128.html">u128</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-15" class="type trait-impl has-srclink"><a href="#associatedtype.X-15" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u128.html">u128</a></h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-UniformSampler-15" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#569" title="goto source code">source</a></div><a href="#impl-UniformSampler-15" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.UniformSampler.html" title="trait rand_distr::uniform::UniformSampler">UniformSampler</a> for <a class="struct" href="struct.UniformInt.html" title="struct rand_distr::uniform::UniformInt">UniformInt</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</h3></div></summary><div class="impl-items"><div id="associatedtype.X-16" class="type trait-impl has-srclink"><a href="#associatedtype.X-16" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></div></div></details></div><script type="text/javascript" src="../../implementors/rand/distributions/uniform/trait.UniformSampler.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="rand_distr" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (1bd4fdc94 2022-01-12)" ></div>
</body></html>