deploy: de38ae62916547ad097c066f94a32e9ba7790eeb

This commit is contained in:
NotAShelf 2025-02-05 00:10:33 +00:00
commit 9a86359447
28502 changed files with 1261284 additions and 0 deletions

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/enum.BernoulliError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/enum.BernoulliError.html">../../../rand/distributions/enum.BernoulliError.html</a>...</p>
<script>location.replace("../../../rand/distributions/enum.BernoulliError.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.Bernoulli.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.Bernoulli.html">../../../rand/distributions/struct.Bernoulli.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.Bernoulli.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.DistIter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.DistIter.html">../../../rand/distributions/struct.DistIter.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.DistIter.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.DistMap.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.DistMap.html">../../../rand/distributions/struct.DistMap.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.DistMap.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/trait.DistString.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/trait.DistString.html">../../../rand/distributions/trait.DistString.html</a>...</p>
<script>location.replace("../../../rand/distributions/trait.DistString.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/trait.Distribution.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/trait.Distribution.html">../../../rand/distributions/trait.Distribution.html</a>...</p>
<script>location.replace("../../../rand/distributions/trait.Distribution.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.Open01.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.Open01.html">../../../rand/distributions/struct.Open01.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.Open01.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.OpenClosed01.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.OpenClosed01.html">../../../rand/distributions/struct.OpenClosed01.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.OpenClosed01.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,63 @@
<!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="Generating random samples from probability distributions"><title>rand::distributions - 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" 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 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module distributions</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#the-standard-distribution" title="The `Standard` distribution">The <code>Standard</code> distribution</a><ul><li><a href="#random-characters" title="Random characters">Random characters</a></li></ul></li><li><a href="#uniform-numeric-ranges" title="Uniform numeric ranges">Uniform numeric ranges</a><ul><li><a href="#open-and-half-open-ranges" title="Open and half-open ranges">Open and half-open ranges</a></li></ul></li><li><a href="#non-uniform-sampling" title="Non-uniform sampling">Non-uniform sampling</a></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</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</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</a></span><h1>Module <span>distributions</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/distributions/mod.rs.html#10-218">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Generating random samples from probability distributions</p>
<p>This module is the home of the <a href="trait.Distribution.html" title="trait rand::distributions::Distribution"><code>Distribution</code></a> trait and several of its
implementations. It is the workhorse behind some of the convenient
functionality of the <a href="../trait.Rng.html" title="trait rand::Rng"><code>Rng</code></a> trait, e.g. <a href="../trait.Rng.html#method.gen" title="method rand::Rng::gen"><code>Rng::gen</code></a> and of course
<a href="../trait.Rng.html#method.sample" title="method rand::Rng::sample"><code>Rng::sample</code></a>.</p>
<p>Abstractly, a <a href="https://en.wikipedia.org/wiki/Probability_distribution">probability distribution</a> describes the probability of
occurrence of each value in its sample space.</p>
<p>More concretely, an implementation of <code>Distribution&lt;T&gt;</code> for type <code>X</code> is an
algorithm for choosing values from the sample space (a subset of <code>T</code>)
according to the distribution <code>X</code> represents, using an external source of
randomness (an RNG supplied to the <code>sample</code> function).</p>
<p>A type <code>X</code> may implement <code>Distribution&lt;T&gt;</code> for multiple types <code>T</code>.
Any type implementing <a href="trait.Distribution.html" title="trait rand::distributions::Distribution"><code>Distribution</code></a> is stateless (i.e. immutable),
but it may have internal parameters set at construction time (for example,
<a href="struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a> allows specification of its sample space as a range within <code>T</code>).</p>
<h2 id="the-standard-distribution"><a class="doc-anchor" href="#the-standard-distribution">§</a>The <code>Standard</code> distribution</h2>
<p>The <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> distribution is important to mention. This is the
distribution used by <a href="../trait.Rng.html#method.gen" title="method rand::Rng::gen"><code>Rng::gen</code></a> and represents the “default” way to
produce a random value for many different types, including most primitive
types, tuples, arrays, and a few derived types. See the documentation of
<a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> for more details.</p>
<p>Implementing <code>Distribution&lt;T&gt;</code> for <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> for user types <code>T</code> makes it
possible to generate type <code>T</code> with <a href="../trait.Rng.html#method.gen" title="method rand::Rng::gen"><code>Rng::gen</code></a>, and by extension also
with the <a href="../fn.random.html" title="fn rand::random"><code>random</code></a> function.</p>
<h3 id="random-characters"><a class="doc-anchor" href="#random-characters">§</a>Random characters</h3>
<p><a href="struct.Alphanumeric.html" title="struct rand::distributions::Alphanumeric"><code>Alphanumeric</code></a> is a simple distribution to sample random letters and
numbers of the <code>char</code> type; in contrast <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> may sample any valid
<code>char</code>.</p>
<h2 id="uniform-numeric-ranges"><a class="doc-anchor" href="#uniform-numeric-ranges">§</a>Uniform numeric ranges</h2>
<p>The <a href="struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a> distribution is more flexible than <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a>, but also
more specialised: it supports fewer target types, but allows the sample
space to be specified as an arbitrary range within its target type <code>T</code>.
Both <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> and <a href="struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a> are in some sense uniform distributions.</p>
<p>Values may be sampled from this distribution using [<code>Rng::sample(Range)</code>] or
by creating a distribution object with <a href="struct.Uniform.html#method.new" title="associated function rand::distributions::Uniform::new"><code>Uniform::new</code></a>,
<a href="struct.Uniform.html#method.new_inclusive" title="associated function rand::distributions::Uniform::new_inclusive"><code>Uniform::new_inclusive</code></a> or <code>From&lt;Range&gt;</code>. When the range limits are not
known at compile time it is typically faster to reuse an existing
<code>Uniform</code> object than to call [<code>Rng::sample(Range)</code>].</p>
<p>User types <code>T</code> may also implement <code>Distribution&lt;T&gt;</code> for <a href="struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a>,
although this is less straightforward than for <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> (see the
documentation in the <a href="uniform/index.html" title="mod rand::distributions::uniform"><code>uniform</code></a> module). Doing so enables generation of
values of type <code>T</code> with [<code>Rng::sample(Range)</code>].</p>
<h3 id="open-and-half-open-ranges"><a class="doc-anchor" href="#open-and-half-open-ranges">§</a>Open and half-open ranges</h3>
<p>There are surprisingly many ways to uniformly generate random floats. A
range between 0 and 1 is standard, but the exact bounds (open vs closed)
and accuracy differ. In addition to the <a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> distribution Rand offers
<a href="struct.Open01.html" title="struct rand::distributions::Open01"><code>Open01</code></a> and <a href="struct.OpenClosed01.html" title="struct rand::distributions::OpenClosed01"><code>OpenClosed01</code></a>. See “Floating point implementation” section of
<a href="struct.Standard.html" title="struct rand::distributions::Standard"><code>Standard</code></a> documentation for more details.</p>
<h2 id="non-uniform-sampling"><a class="doc-anchor" href="#non-uniform-sampling">§</a>Non-uniform sampling</h2>
<p>Sampling a simple true/false outcome with a given probability has a name:
the <a href="struct.Bernoulli.html" title="struct rand::distributions::Bernoulli"><code>Bernoulli</code></a> distribution (this is used by <a href="../trait.Rng.html#method.gen_bool" title="method rand::Rng::gen_bool"><code>Rng::gen_bool</code></a>).</p>
<p>For weighted sampling from a sequence of discrete values, use the
<a href="struct.WeightedIndex.html" title="struct rand::distributions::WeightedIndex"><code>WeightedIndex</code></a> distribution.</p>
<p>This crate no longer includes other non-uniform distributions; instead
it is recommended that you use either <a href="https://crates.io/crates/rand_distr"><code>rand_distr</code></a> or <a href="https://crates.io/crates/statrs"><code>statrs</code></a>.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="uniform/index.html" title="mod rand::distributions::uniform">uniform</a></div><div class="desc docblock-short">A distribution uniformly sampling numbers within a given range.</div></li><li><div class="item-name"><a class="mod" href="weighted/index.html" title="mod rand::distributions::weighted">weighted</a><wbr><span class="stab deprecated" title="">Deprecated</span></div><div class="desc docblock-short">Weighted index sampling</div></li></ul><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.Alphanumeric.html" title="struct rand::distributions::Alphanumeric">Alphanumeric</a></div><div class="desc docblock-short">Sample a <code>u8</code>, uniformly distributed over ASCII letters and numbers:
a-z, A-Z and 0-9.</div></li><li><div class="item-name"><a class="struct" href="struct.Bernoulli.html" title="struct rand::distributions::Bernoulli">Bernoulli</a></div><div class="desc docblock-short">The Bernoulli distribution.</div></li><li><div class="item-name"><a class="struct" href="struct.DistIter.html" title="struct rand::distributions::DistIter">Dist<wbr>Iter</a></div><div class="desc docblock-short">An iterator that generates random values of <code>T</code> with distribution <code>D</code>,
using <code>R</code> as the source of randomness.</div></li><li><div class="item-name"><a class="struct" href="struct.DistMap.html" title="struct rand::distributions::DistMap">DistMap</a></div><div class="desc docblock-short">A distribution of values of type <code>S</code> derived from the distribution <code>D</code>
by mapping its output of type <code>T</code> through the closure <code>F</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Open01.html" title="struct rand::distributions::Open01">Open01</a></div><div class="desc docblock-short">A distribution to sample floating point numbers uniformly in the open
interval <code>(0, 1)</code>, i.e. not including either endpoint.</div></li><li><div class="item-name"><a class="struct" href="struct.OpenClosed01.html" title="struct rand::distributions::OpenClosed01">Open<wbr>Closed01</a></div><div class="desc docblock-short">A distribution to sample floating point numbers uniformly in the half-open
interval <code>(0, 1]</code>, i.e. including 1 but not 0.</div></li><li><div class="item-name"><a class="struct" href="struct.Slice.html" title="struct rand::distributions::Slice">Slice</a></div><div class="desc docblock-short">A distribution to sample items uniformly from a slice.</div></li><li><div class="item-name"><a class="struct" href="struct.Standard.html" title="struct rand::distributions::Standard">Standard</a></div><div class="desc docblock-short">A generic random value distribution, implemented for many primitive types.
Usually generates values with a numerically uniform distribution, and with a
range appropriate to the type.</div></li><li><div class="item-name"><a class="struct" href="struct.Uniform.html" title="struct rand::distributions::Uniform">Uniform</a></div><div class="desc docblock-short">Sample values uniformly between two bounds.</div></li><li><div class="item-name"><a class="struct" href="struct.WeightedIndex.html" title="struct rand::distributions::WeightedIndex">Weighted<wbr>Index</a></div><div class="desc docblock-short">A distribution using weighted sampling of discrete items</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.BernoulliError.html" title="enum rand::distributions::BernoulliError">Bernoulli<wbr>Error</a></div><div class="desc docblock-short">Error type returned from <code>Bernoulli::new</code>.</div></li><li><div class="item-name"><a class="enum" href="enum.WeightedError.html" title="enum rand::distributions::WeightedError">Weighted<wbr>Error</a></div><div class="desc docblock-short">Error type returned from <code>WeightedIndex::new</code>.</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.DistString.html" title="trait rand::distributions::DistString">Dist<wbr>String</a></div><div class="desc docblock-short"><code>String</code> sampler</div></li><li><div class="item-name"><a class="trait" href="trait.Distribution.html" title="trait rand::distributions::Distribution">Distribution</a></div><div class="desc docblock-short">Types (distributions) that can be used to create a random instance of <code>T</code>.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.Alphanumeric.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.Alphanumeric.html">../../../rand/distributions/struct.Alphanumeric.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.Alphanumeric.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["BernoulliError","WeightedError"],"mod":["uniform","weighted"],"struct":["Alphanumeric","Bernoulli","DistIter","DistMap","Open01","OpenClosed01","Slice","Standard","Uniform","WeightedIndex"],"trait":["DistString","Distribution"]};

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.Slice.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.Slice.html">../../../rand/distributions/struct.Slice.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.Slice.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,24 @@
<!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="`String` sampler"><title>DistString in rand::distributions - 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" 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Dist<wbr>String</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.append_string" title="append_string">append_string</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.sample_string" title="sample_string">sample_string</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>distributions</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</a>::<wbr><a href="index.html">distributions</a></span><h1>Trait <span class="trait">DistString</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/distributions/distribution.rs.html#197-208">Source</a> </span></div><pre class="rust item-decl"><code>pub trait DistString {
// Required method
fn <a href="#tymethod.append_string" class="fn">append_string</a>&lt;R: <a class="trait" href="../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(
&amp;self,
rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>,
string: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
len: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
);
// Provided method
fn <a href="#method.sample_string" class="fn">sample_string</a>&lt;R: <a class="trait" href="../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>, len: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>String</code> sampler</p>
<p>Sampling a <code>String</code> of random characters is not quite the same as collecting
a sequence of chars. This trait contains some helpers.</p>
</div></details><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.append_string" class="method"><a class="src rightside" href="../../src/rand/distributions/distribution.rs.html#199">Source</a><h4 class="code-header">fn <a href="#tymethod.append_string" class="fn">append_string</a>&lt;R: <a class="trait" href="../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(
&amp;self,
rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>,
string: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
len: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
)</h4></section></summary><div class="docblock"><p>Append <code>len</code> random chars to <code>string</code></p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.sample_string" class="method"><a class="src rightside" href="../../src/rand/distributions/distribution.rs.html#203-207">Source</a><h4 class="code-header">fn <a href="#method.sample_string" class="fn">sample_string</a>&lt;R: <a class="trait" href="../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>, len: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Generate a <code>String</code> of <code>len</code> random chars</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.1/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-DistString-for-Alphanumeric" class="impl"><a class="src rightside" href="../../src/rand/distributions/other.rs.html#128-135">Source</a><a href="#impl-DistString-for-Alphanumeric" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.DistString.html" title="trait rand::distributions::DistString">DistString</a> for <a class="struct" href="struct.Alphanumeric.html" title="struct rand::distributions::Alphanumeric">Alphanumeric</a></h3></section><section id="impl-DistString-for-Standard" class="impl"><a class="src rightside" href="../../src/rand/distributions/other.rs.html#98-106">Source</a><a href="#impl-DistString-for-Standard" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.DistString.html" title="trait rand::distributions::DistString">DistString</a> for <a class="struct" href="struct.Standard.html" title="struct rand::distributions::Standard">Standard</a></h3></section><div class="docblock"><p>Note: the <code>String</code> is potentially left with excess capacity; optionally the
user may call <code>string.shrink_to_fit()</code> afterwards.</p>
</div></div><script src="../../trait.impl/rand/distributions/distribution/trait.DistString.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,82 @@
<!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 distribution uniformly sampling numbers within a given range."><title>rand::distributions::uniform - 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" 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 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module uniform</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example-usage" title="Example usage">Example usage</a></li><li><a href="#extending-uniform-to-support-a-custom-type" title="Extending `Uniform` to support a custom type">Extending <code>Uniform</code> to support a custom type</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><a href="../index.html">In rand::<wbr>distributions</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</a>::<wbr><a href="../index.html">distributions</a></span><h1>Module <span>uniform</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/distributions/uniform.rs.html#10-1658">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A distribution uniformly sampling numbers within a given range.</p>
<p><a href="../struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a> is the standard distribution to sample uniformly from a range;
e.g. <code>Uniform::new_inclusive(1, 6)</code> can sample integers from 1 to 6, like a
standard die. <a href="../../trait.Rng.html#method.gen_range" title="method rand::Rng::gen_range"><code>Rng::gen_range</code></a> supports any type supported by
<a href="../struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a>.</p>
<p>This distribution is provided with support for several primitive types
(all integer and floating-point types) as well as <a href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration"><code>std::time::Duration</code></a>,
and supports extension to user-defined types via a type-specific <em>back-end</em>
implementation.</p>
<p>The types <a href="struct.UniformInt.html" title="struct rand::distributions::uniform::UniformInt"><code>UniformInt</code></a>, <a href="struct.UniformFloat.html" title="struct rand::distributions::uniform::UniformFloat"><code>UniformFloat</code></a> and <a href="struct.UniformDuration.html" title="struct rand::distributions::uniform::UniformDuration"><code>UniformDuration</code></a> are the
back-ends supporting sampling from primitive integer and floating-point
ranges as well as from <a href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration"><code>std::time::Duration</code></a>; these types do not normally
need to be used directly (unless implementing a derived back-end).</p>
<h2 id="example-usage"><a class="doc-anchor" href="#example-usage">§</a>Example usage</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand::{Rng, thread_rng};
<span class="kw">use </span>rand::distributions::Uniform;
<span class="kw">let </span><span class="kw-2">mut </span>rng = thread_rng();
<span class="kw">let </span>side = Uniform::new(-<span class="number">10.0</span>, <span class="number">10.0</span>);
<span class="comment">// sample between 1 and 10 points
</span><span class="kw">for _ in </span><span class="number">0</span>..rng.gen_range(<span class="number">1</span>..=<span class="number">10</span>) {
<span class="comment">// sample a point from the square with sides -10 - 10 in two dimensions
</span><span class="kw">let </span>(x, y) = (rng.sample(side), rng.sample(side));
<span class="macro">println!</span>(<span class="string">"Point: {}, {}"</span>, x, y);
}</code></pre></div>
<h2 id="extending-uniform-to-support-a-custom-type"><a class="doc-anchor" href="#extending-uniform-to-support-a-custom-type">§</a>Extending <code>Uniform</code> to support a custom type</h2>
<p>To extend <a href="../struct.Uniform.html" title="struct rand::distributions::Uniform"><code>Uniform</code></a> to support your own types, write a back-end which
implements the <a href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler"><code>UniformSampler</code></a> trait, then implement the <a href="trait.SampleUniform.html" title="trait rand::distributions::uniform::SampleUniform"><code>SampleUniform</code></a>
helper trait to “register” your back-end. See the <code>MyF32</code> example below.</p>
<p>At a minimum, the back-end needs to store any parameters needed for sampling
(e.g. the target range) and implement <code>new</code>, <code>new_inclusive</code> and <code>sample</code>.
Those methods should include an assert to check the range is valid (i.e.
<code>low &lt; high</code>). The example below merely wraps another back-end.</p>
<p>The <code>new</code>, <code>new_inclusive</code> and <code>sample_single</code> functions use arguments of
type SampleBorrow<X> in order to support passing in values by reference or
by value. In the implementation of these functions, you can choose to
simply use the reference returned by <a href="trait.SampleBorrow.html#tymethod.borrow" title="method rand::distributions::uniform::SampleBorrow::borrow"><code>SampleBorrow::borrow</code></a>, or you can choose
to copy or clone the value, whatever is appropriate for your type.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rand::distributions::uniform::{Uniform, SampleUniform,
UniformSampler, UniformFloat, SampleBorrow};
<span class="kw">struct </span>MyF32(f32);
<span class="attr">#[derive(Clone, Copy, Debug)]
</span><span class="kw">struct </span>UniformMyF32(UniformFloat&lt;f32&gt;);
<span class="kw">impl </span>UniformSampler <span class="kw">for </span>UniformMyF32 {
<span class="kw">type </span>X = MyF32;
<span class="kw">fn </span>new&lt;B1, B2&gt;(low: B1, high: B2) -&gt; <span class="self">Self
</span><span class="kw">where </span>B1: SampleBorrow&lt;<span class="self">Self</span>::X&gt; + Sized,
B2: SampleBorrow&lt;<span class="self">Self</span>::X&gt; + Sized
{
UniformMyF32(UniformFloat::&lt;f32&gt;::new(low.borrow().<span class="number">0</span>, high.borrow().<span class="number">0</span>))
}
<span class="kw">fn </span>new_inclusive&lt;B1, B2&gt;(low: B1, high: B2) -&gt; <span class="self">Self
</span><span class="kw">where </span>B1: SampleBorrow&lt;<span class="self">Self</span>::X&gt; + Sized,
B2: SampleBorrow&lt;<span class="self">Self</span>::X&gt; + Sized
{
UniformMyF32(UniformFloat::&lt;f32&gt;::new_inclusive(
low.borrow().<span class="number">0</span>,
high.borrow().<span class="number">0</span>,
))
}
<span class="kw">fn </span>sample&lt;R: Rng + <span class="question-mark">?</span>Sized&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, rng: <span class="kw-2">&amp;mut </span>R) -&gt; <span class="self">Self</span>::X {
MyF32(<span class="self">self</span>.<span class="number">0</span>.sample(rng))
}
}
<span class="kw">impl </span>SampleUniform <span class="kw">for </span>MyF32 {
<span class="kw">type </span>Sampler = UniformMyF32;
}
<span class="kw">let </span>(low, high) = (MyF32(<span class="number">17.0f32</span>), MyF32(<span class="number">22.0f32</span>));
<span class="kw">let </span>uniform = Uniform::new(low, high);
<span class="kw">let </span>x = uniform.sample(<span class="kw-2">&amp;mut </span>thread_rng());</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.Uniform.html" title="struct rand::distributions::uniform::Uniform">Uniform</a></div><div class="desc docblock-short">Sample values uniformly between two bounds.</div></li><li><div class="item-name"><a class="struct" href="struct.UniformChar.html" title="struct rand::distributions::uniform::UniformChar">Uniform<wbr>Char</a></div><div class="desc docblock-short">The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler"><code>UniformSampler</code></a> for <code>char</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.UniformDuration.html" title="struct rand::distributions::uniform::UniformDuration">Uniform<wbr>Duration</a></div><div class="desc docblock-short">The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler"><code>UniformSampler</code></a> for <code>Duration</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.UniformFloat.html" title="struct rand::distributions::uniform::UniformFloat">Uniform<wbr>Float</a></div><div class="desc docblock-short">The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler"><code>UniformSampler</code></a> for floating-point types.</div></li><li><div class="item-name"><a class="struct" href="struct.UniformInt.html" title="struct rand::distributions::uniform::UniformInt">Uniform<wbr>Int</a></div><div class="desc docblock-short">The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler"><code>UniformSampler</code></a> for integer types.</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.SampleBorrow.html" title="trait rand::distributions::uniform::SampleBorrow">Sample<wbr>Borrow</a></div><div class="desc docblock-short">Helper trait similar to <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow"><code>Borrow</code></a> but implemented
only for SampleUniform and references to SampleUniform in
order to resolve ambiguity issues.</div></li><li><div class="item-name"><a class="trait" href="trait.SampleRange.html" title="trait rand::distributions::uniform::SampleRange">Sample<wbr>Range</a></div><div class="desc docblock-short">Range that supports generating a single sample efficiently.</div></li><li><div class="item-name"><a class="trait" href="trait.SampleUniform.html" title="trait rand::distributions::uniform::SampleUniform">Sample<wbr>Uniform</a></div><div class="desc docblock-short">Helper trait for creating objects using the correct implementation of
<a href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler"><code>UniformSampler</code></a> for the sampling type.</div></li><li><div class="item-name"><a class="trait" href="trait.UniformSampler.html" title="trait rand::distributions::uniform::UniformSampler">Uniform<wbr>Sampler</a></div><div class="desc docblock-short">Helper trait handling actual uniform sampling.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Uniform","UniformChar","UniformDuration","UniformFloat","UniformInt"],"trait":["SampleBorrow","SampleRange","SampleUniform","UniformSampler"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,10 @@
<!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 similar to `Borrow` but implemented only for SampleUniform and references to SampleUniform in order to resolve ambiguity issues."><title>SampleBorrow in rand::distributions::uniform - 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" 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Sample<wbr>Borrow</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.borrow" title="borrow">borrow</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-SampleBorrow%3CBorrowed%3E-for-%26Borrowed" title="&#38;&#39;a Borrowed">&#38;&#39;a Borrowed</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>distributions::<wbr>uniform</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</a>::<wbr><a href="../index.html">distributions</a>::<wbr><a href="index.html">uniform</a></span><h1>Trait <span class="trait">SampleBorrow</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/distributions/uniform.rs.html#322-327">Source</a> </span></div><pre class="rust item-decl"><code>pub trait SampleBorrow&lt;Borrowed&gt; {
// Required method
fn <a href="#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;Borrowed</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Helper trait similar to <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow"><code>Borrow</code></a> but implemented
only for SampleUniform and references to SampleUniform in
order to resolve ambiguity issues.</p>
</div></details><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.borrow" class="method"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#326">Source</a><h4 class="code-header">fn <a href="#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;Borrowed</a></h4></section></summary><div class="docblock"><p>Immutably borrows from an owned value. See <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" title="method core::borrow::Borrow::borrow"><code>Borrow::borrow</code></a></p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-SampleBorrow%3CBorrowed%3E-for-%26Borrowed" class="impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#336-343">Source</a><a href="#impl-SampleBorrow%3CBorrowed%3E-for-%26Borrowed" class="anchor">§</a><h3 class="code-header">impl&lt;'a, Borrowed&gt; <a class="trait" href="trait.SampleBorrow.html" title="trait rand::distributions::uniform::SampleBorrow">SampleBorrow</a>&lt;Borrowed&gt; for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;'a Borrowed</a><div class="where">where
Borrowed: <a class="trait" href="trait.SampleUniform.html" title="trait rand::distributions::uniform::SampleUniform">SampleUniform</a>,</div></h3></section></summary><div class="impl-items"><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#340-342">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;Borrowed</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-SampleBorrow%3CBorrowed%3E-for-Borrowed" class="impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#328-335">Source</a><a href="#impl-SampleBorrow%3CBorrowed%3E-for-Borrowed" class="anchor">§</a><h3 class="code-header">impl&lt;Borrowed&gt; <a class="trait" href="trait.SampleBorrow.html" title="trait rand::distributions::uniform::SampleBorrow">SampleBorrow</a>&lt;Borrowed&gt; for Borrowed<div class="where">where
Borrowed: <a class="trait" href="trait.SampleUniform.html" title="trait rand::distributions::uniform::SampleUniform">SampleUniform</a>,</div></h3></section></div><script src="../../../trait.impl/rand/distributions/uniform/trait.SampleBorrow.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,10 @@
<!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="Range that supports generating a single sample efficiently."><title>SampleRange in rand::distributions::uniform - 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" 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Sample<wbr>Range</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.is_empty" title="is_empty">is_empty</a></li><li><a href="#tymethod.sample_single" title="sample_single">sample_single</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-SampleRange%3CT%3E-for-Range%3CT%3E" title="Range&#60;T&#62;">Range&#60;T&#62;</a></li><li><a href="#impl-SampleRange%3CT%3E-for-RangeInclusive%3CT%3E" title="RangeInclusive&#60;T&#62;">RangeInclusive&#60;T&#62;</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>distributions::<wbr>uniform</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</a>::<wbr><a href="../index.html">distributions</a>::<wbr><a href="index.html">uniform</a></span><h1>Trait <span class="trait">SampleRange</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/distributions/uniform.rs.html#349-355">Source</a> </span></div><pre class="rust item-decl"><code>pub trait SampleRange&lt;T&gt; {
// Required methods
fn <a href="#tymethod.sample_single" class="fn">sample_single</a>&lt;R: <a class="trait" href="../../trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(self, rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>) -&gt; T;
<span class="item-spacer"></span> fn <a href="#tymethod.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Range that supports generating a single sample efficiently.</p>
<p>Any type implementing this trait can be used to specify the sampled range
for <code>Rng::gen_range</code>.</p>
</div></details><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.sample_single" class="method"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#351">Source</a><h4 class="code-header">fn <a href="#tymethod.sample_single" class="fn">sample_single</a>&lt;R: <a class="trait" href="../../trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(self, rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>) -&gt; T</h4></section></summary><div class="docblock"><p>Generate a sample from the given range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.is_empty" class="method"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#354">Source</a><h4 class="code-header">fn <a href="#tymethod.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Check whether the range is empty.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.1/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-SampleRange%3CT%3E-for-Range%3CT%3E" class="impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#357-367">Source</a><a href="#impl-SampleRange%3CT%3E-for-Range%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.SampleUniform.html" title="trait rand::distributions::uniform::SampleUniform">SampleUniform</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&gt; <a class="trait" href="trait.SampleRange.html" title="trait rand::distributions::uniform::SampleRange">SampleRange</a>&lt;T&gt; for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.sample_single" class="method trait-impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#359-361">Source</a><a href="#method.sample_single" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.sample_single" class="fn">sample_single</a>&lt;R: <a class="trait" href="../../trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(self, rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>) -&gt; T</h4></section><section id="method.is_empty" class="method trait-impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#364-366">Source</a><a href="#method.is_empty" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-SampleRange%3CT%3E-for-RangeInclusive%3CT%3E" class="impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#369-379">Source</a><a href="#impl-SampleRange%3CT%3E-for-RangeInclusive%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.SampleUniform.html" title="trait rand::distributions::uniform::SampleUniform">SampleUniform</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&gt; <a class="trait" href="trait.SampleRange.html" title="trait rand::distributions::uniform::SampleRange">SampleRange</a>&lt;T&gt; for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/ops/range/struct.RangeInclusive.html" title="struct core::ops::range::RangeInclusive">RangeInclusive</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.sample_single-1" class="method trait-impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#371-373">Source</a><a href="#method.sample_single-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.sample_single" class="fn">sample_single</a>&lt;R: <a class="trait" href="../../trait.RngCore.html" title="trait rand::RngCore">RngCore</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(self, rng: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut R</a>) -&gt; T</h4></section><section id="method.is_empty-1" class="method trait-impl"><a class="src rightside" href="../../../src/rand/distributions/uniform.rs.html#376-378">Source</a><a href="#method.is_empty-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../../trait.impl/rand/distributions/uniform/trait.SampleRange.js" data-ignore-extern-crates="core" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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="API documentation for the Rust `alias_method` mod in crate `rand`."><title>rand::distributions::weighted::alias_method - 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" 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 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module alias_<wbr>method</a></h2><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><a href="../index.html">In rand::<wbr>distributions::<wbr>weighted</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</a>::<wbr><a href="../../index.html">distributions</a>::<wbr><a href="../index.html">weighted</a></span><h1>Module <span>alias_method</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/distributions/weighted.rs.html#18">Source</a> </span></div><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.8.0: moved to rand_distr crate</span></div></span><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.WeightedIndex.html" title="struct rand::distributions::weighted::alias_method::WeightedIndex">Weighted<wbr>Index</a><wbr><span class="stab deprecated" title="">Deprecated</span></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.Weight.html" title="trait rand::distributions::weighted::alias_method::Weight">Weight</a><wbr><span class="stab deprecated" title="">Deprecated</span></div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["WeightedIndex"],"trait":["Weight"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
<!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="Weighted index sampling"><title>rand::distributions::weighted - 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" 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 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/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/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" alt="logo"></a><h2><a href="../../../rand/index.html">rand</a><span class="version">0.8.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module weighted</a></h2><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rand::<wbr>distributions</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</a>::<wbr><a href="../index.html">distributions</a></span><h1>Module <span>weighted</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/distributions/weighted.rs.html#9-47">Source</a> </span></div><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.8.0: use rand::distributions::{WeightedIndex, WeightedError} instead</span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Weighted index sampling</p>
<p>This module is deprecated. Use <a href="../struct.WeightedIndex.html" title="struct rand::distributions::WeightedIndex"><code>crate::distributions::WeightedIndex</code></a> and
<a href="../enum.WeightedError.html" title="enum rand::distributions::WeightedError"><code>crate::distributions::WeightedError</code></a> instead.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.WeightedIndex"><code>pub use super::<a class="struct" href="../struct.WeightedIndex.html" title="struct rand::distributions::WeightedIndex">WeightedIndex</a>;</code></div></li><li><div class="item-name" id="reexport.WeightedError"><code>pub use super::<a class="enum" href="../enum.WeightedError.html" title="enum rand::distributions::WeightedError">WeightedError</a>;</code></div></li></ul><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="alias_method/index.html" title="mod rand::distributions::weighted::alias_method">alias_<wbr>method</a><wbr><span class="stab deprecated" title="">Deprecated</span></div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["alias_method"]};

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/enum.WeightedError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/enum.WeightedError.html">../../../rand/distributions/enum.WeightedError.html</a>...</p>
<script>location.replace("../../../rand/distributions/enum.WeightedError.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/distributions/struct.WeightedIndex.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distributions/struct.WeightedIndex.html">../../../rand/distributions/struct.WeightedIndex.html</a>...</p>
<script>location.replace("../../../rand/distributions/struct.WeightedIndex.html" + location.search + location.hash);</script>
</body>
</html>