blob: 36075d905af7e0456354867daefdcf4a98eefea5 [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" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" 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">&#9776;</button><a class="sidebar-logo" href="../../rand_distr/index.html"><div class="logo-container"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../rand_distr/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="#">UniformSampler</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.X">X</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.new">new</a></li><li><a href="#tymethod.new_inclusive">new_inclusive</a></li><li><a href="#tymethod.sample">sample</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.sample_single">sample_single</a></li><li><a href="#method.sample_single_inclusive">sample_single_inclusive</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In rand_distr::uniform</a></h2></div></nav><main><div class="width-limiter"><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"><a href="../../help.html">?</a></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><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">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></h1><span class="out-of-band"><a class="srclink" href="../../src/rand/distributions/uniform.rs.html#231">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="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;&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>;
<span class="item-spacer"></span> 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;&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>;
<span class="item-spacer"></span> 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;&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;&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>,
{ ... }
<span class="item-spacer"></span> 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;&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="required-associated-types" class="small-section-header">Required Associated Types<a href="#required-associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="associatedtype.X" class="method has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#233">source</a><h4 class="code-header">type <a href="#associatedtype.X" class="associatedtype">X</a></h4></section></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 method-toggle" open><summary><section id="tymethod.new" class="method has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#240-243">source</a><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;,</span></h4></section></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 method-toggle" open><summary><section id="tymethod.new_inclusive" class="method has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#250-253">source</a><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;,</span></h4></section></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 method-toggle" open><summary><section id="tymethod.sample" class="method has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#256">source</a><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>,</span></h4></section></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 method-toggle" open><summary><section id="method.sample_single" class="method has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#277-280">source</a><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;,</span></h4></section></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>rand::{thread_rng, distributions::uniform::{SampleUniform, UniformSampler}};
<span class="kw">fn </span>sample_from_range&lt;T: SampleUniform&gt;(lb: T, ub: T) -&gt; T {
<span class="kw">let </span><span class="kw-2">mut </span>rng = thread_rng();
&lt;T <span class="kw">as </span>SampleUniform&gt;::Sampler::sample_single(lb, ub, <span class="kw-2">&amp;mut </span>rng)
}</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sample_single_inclusive" class="method has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#294-297">source</a><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;,</span></h4></section></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 id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformChar" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#749">source</a><a href="#impl-UniformSampler-for-UniformChar" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-1" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformDuration" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#1050">source</a><a href="#impl-UniformSampler-for-UniformDuration" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-2" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformFloat%3Cf32%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#998">source</a><a href="#impl-UniformSampler-for-UniformFloat%3Cf32%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-3" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformFloat%3Cf64%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#999">source</a><a href="#impl-UniformSampler-for-UniformFloat%3Cf64%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-4" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Ci8%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#559">source</a><a href="#impl-UniformSampler-for-UniformInt%3Ci8%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-5" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Ci16%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#560">source</a><a href="#impl-UniformSampler-for-UniformInt%3Ci16%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-6" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Ci32%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#561">source</a><a href="#impl-UniformSampler-for-UniformInt%3Ci32%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-7" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Ci64%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#562">source</a><a href="#impl-UniformSampler-for-UniformInt%3Ci64%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-8" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Ci128%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#563">source</a><a href="#impl-UniformSampler-for-UniformInt%3Ci128%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-9" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cisize%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#564">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cisize%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-10" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cu8%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#565">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cu8%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-11" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cu16%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#566">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cu16%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-12" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cu32%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#567">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cu32%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-13" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cu64%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#568">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cu64%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-14" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cu128%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#570">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cu128%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-15" class="associatedtype 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></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UniformSampler-for-UniformInt%3Cusize%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/rand/distributions/uniform.rs.html#569">source</a><a href="#impl-UniformSampler-for-UniformInt%3Cusize%3E" class="anchor"></a><h3 class="code-header">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></section></summary><div class="impl-items"><section id="associatedtype.X-16" class="associatedtype 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></section></div></details></div><script src="../../implementors/rand/distributions/uniform/trait.UniformSampler.js" data-ignore-extern-crates="rand" async></script></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.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>