Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

1
target/doc/rand/all.html Normal file

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/distr/enum.BernoulliError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/enum.BernoulliError.html">../../../rand/distr/enum.BernoulliError.html</a>...</p>
<script>location.replace("../../../rand/distr/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/distr/struct.Bernoulli.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.Bernoulli.html">../../../rand/distr/struct.Bernoulli.html</a>...</p>
<script>location.replace("../../../rand/distr/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/distr/struct.Iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.Iter.html">../../../rand/distr/struct.Iter.html</a>...</p>
<script>location.replace("../../../rand/distr/struct.Iter.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/distr/struct.Map.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.Map.html">../../../rand/distr/struct.Map.html</a>...</p>
<script>location.replace("../../../rand/distr/struct.Map.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/distr/trait.Distribution.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/trait.Distribution.html">../../../rand/distr/trait.Distribution.html</a>...</p>
<script>location.replace("../../../rand/distr/trait.Distribution.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/distr/trait.SampleString.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/trait.SampleString.html">../../../rand/distr/trait.SampleString.html</a>...</p>
<script>location.replace("../../../rand/distr/trait.SampleString.html" + location.search + location.hash);</script>
</body>
</html>

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/distr/struct.Open01.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.Open01.html">../../../rand/distr/struct.Open01.html</a>...</p>
<script>location.replace("../../../rand/distr/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/distr/struct.OpenClosed01.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.OpenClosed01.html">../../../rand/distr/struct.OpenClosed01.html</a>...</p>
<script>location.replace("../../../rand/distr/struct.OpenClosed01.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,55 @@
<!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::distr - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module distr</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module distr</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#the-standard-uniform-distribution" title="The Standard Uniform distribution">The Standard Uniform distribution</a><ul><li><a href="#other-standard-uniform-distributions" title="Other standard uniform distributions">Other standard uniform distributions</a></li></ul></li><li><a href="#parameterized-uniform-distributions" title="Parameterized Uniform distributions">Parameterized Uniform distributions</a></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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rand</a></div><h1>Module <span>distr</span>&nbsp;<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/distr/mod.rs.html#10-214">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::distr::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.random" title="method rand::Rng::random"><code>Rng::random</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::distr::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::distr::Uniform"><code>Uniform</code></a> allows specification of its sample space as a range within <code>T</code>).</p>
<h2 id="the-standard-uniform-distribution"><a class="doc-anchor" href="#the-standard-uniform-distribution">§</a>The Standard Uniform distribution</h2>
<p>The <a href="struct.StandardUniform.html" title="struct rand::distr::StandardUniform"><code>StandardUniform</code></a> distribution is important to mention. This is the
distribution used by <a href="../trait.Rng.html#method.random" title="method rand::Rng::random"><code>Rng::random</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.StandardUniform.html" title="struct rand::distr::StandardUniform"><code>StandardUniform</code></a> for more details.</p>
<p>Implementing <a href="trait.Distribution.html" title="trait rand::distr::Distribution"><code>Distribution&lt;T&gt;</code></a> for <a href="struct.StandardUniform.html" title="struct rand::distr::StandardUniform"><code>StandardUniform</code></a> for user types <code>T</code> makes it
possible to generate type <code>T</code> with <a href="../trait.Rng.html#method.random" title="method rand::Rng::random"><code>Rng::random</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="other-standard-uniform-distributions"><a class="doc-anchor" href="#other-standard-uniform-distributions">§</a>Other standard uniform distributions</h3>
<p><a href="struct.Alphanumeric.html" title="struct rand::distr::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.StandardUniform.html" title="struct rand::distr::StandardUniform"><code>StandardUniform</code></a> may sample any valid
<code>char</code>.</p>
<p>Theres also an <a href="struct.Alphabetic.html" title="struct rand::distr::Alphabetic"><code>Alphabetic</code></a> distribution which acts similarly to <a href="struct.Alphanumeric.html" title="struct rand::distr::Alphanumeric"><code>Alphanumeric</code></a> but
doesnt include digits.</p>
<p>For floats (<code>f32</code>, <code>f64</code>), <a href="struct.StandardUniform.html" title="struct rand::distr::StandardUniform"><code>StandardUniform</code></a> samples from <code>[0, 1)</code>. Also
provided are <a href="struct.Open01.html" title="struct rand::distr::Open01"><code>Open01</code></a> (samples from <code>(0, 1)</code>) and <a href="struct.OpenClosed01.html" title="struct rand::distr::OpenClosed01"><code>OpenClosed01</code></a>
(samples from <code>(0, 1]</code>). No option is provided to sample from <code>[0, 1]</code>; it
is suggested to use one of the above half-open ranges since the failure to
sample a value which would have a low chance of being sampled anyway is
rarely an issue in practice.</p>
<h2 id="parameterized-uniform-distributions"><a class="doc-anchor" href="#parameterized-uniform-distributions">§</a>Parameterized Uniform distributions</h2>
<p>The <a href="struct.Uniform.html" title="struct rand::distr::Uniform"><code>Uniform</code></a> distribution provides uniform sampling over a specified
range on a subset of the types supported by the above distributions.</p>
<p>Implementations support single-value-sampling via
<a href="../trait.Rng.html#method.random_range" title="method rand::Rng::random_range"><code>Rng::random_range(Range)</code></a>.
Where a fixed (non-<code>const</code>) range will be sampled many times, it is likely
faster to pre-construct a <a href="trait.Distribution.html" title="trait rand::distr::Distribution"><code>Distribution</code></a> object using
<a href="struct.Uniform.html#method.new" title="associated function rand::distr::Uniform::new"><code>Uniform::new</code></a>, <a href="struct.Uniform.html#method.new_inclusive" title="associated function rand::distr::Uniform::new_inclusive"><code>Uniform::new_inclusive</code></a> or <code>From&lt;Range&gt;</code>.</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::distr::Bernoulli"><code>Bernoulli</code></a> distribution (this is used by <a href="../trait.Rng.html#method.random_bool" title="method rand::Rng::random_bool"><code>Rng::random_bool</code></a>).</p>
<p>For weighted sampling of discrete values see the <a href="weighted/index.html" title="mod rand::distr::weighted"><code>weighted</code></a> module.</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><dl class="item-table"><dt><a class="mod" href="slice/index.html" title="mod rand::distr::slice">slice</a></dt><dd>Distributions over slices</dd><dt><a class="mod" href="uniform/index.html" title="mod rand::distr::uniform">uniform</a></dt><dd>A distribution uniformly sampling numbers within a given range.</dd><dt><a class="mod" href="weighted/index.html" title="mod rand::distr::weighted">weighted</a></dt><dd>Weighted (index) sampling</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Alphabetic.html" title="struct rand::distr::Alphabetic">Alphabetic</a></dt><dd>Sample a <a href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html" title="primitive u8"><code>u8</code></a>, uniformly distributed over letters:
a-z and A-Z.</dd><dt><a class="struct" href="struct.Alphanumeric.html" title="struct rand::distr::Alphanumeric">Alphanumeric</a></dt><dd>Sample a <code>u8</code>, uniformly distributed over ASCII letters and numbers:
a-z, A-Z and 0-9.</dd><dt><a class="struct" href="struct.Bernoulli.html" title="struct rand::distr::Bernoulli">Bernoulli</a></dt><dd>The <a href="https://en.wikipedia.org/wiki/Bernoulli_distribution">Bernoulli distribution</a> <code>Bernoulli(p)</code>.</dd><dt><a class="struct" href="struct.Iter.html" title="struct rand::distr::Iter">Iter</a></dt><dd>An iterator over a <a href="trait.Distribution.html" title="trait rand::distr::Distribution"><code>Distribution</code></a></dd><dt><a class="struct" href="struct.Map.html" title="struct rand::distr::Map">Map</a></dt><dd>A <a href="trait.Distribution.html" title="trait rand::distr::Distribution"><code>Distribution</code></a> which maps sampled values to type <code>S</code></dd><dt><a class="struct" href="struct.Open01.html" title="struct rand::distr::Open01">Open01</a></dt><dd>A distribution to sample floating point numbers uniformly in the open
interval <code>(0, 1)</code>, i.e. not including either endpoint.</dd><dt><a class="struct" href="struct.OpenClosed01.html" title="struct rand::distr::OpenClosed01">Open<wbr>Closed01</a></dt><dd>A distribution to sample floating point numbers uniformly in the half-open
interval <code>(0, 1]</code>, i.e. including 1 but not 0.</dd><dt><a class="struct" href="struct.StandardUniform.html" title="struct rand::distr::StandardUniform">Standard<wbr>Uniform</a></dt><dd>The Standard Uniform distribution</dd><dt><a class="struct" href="struct.Uniform.html" title="struct rand::distr::Uniform">Uniform</a></dt><dd>Sample values uniformly between two bounds.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.BernoulliError.html" title="enum rand::distr::BernoulliError">Bernoulli<wbr>Error</a></dt><dd>Error type returned from <a href="struct.Bernoulli.html#method.new" title="associated function rand::distr::Bernoulli::new"><code>Bernoulli::new</code></a>.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Distribution.html" title="trait rand::distr::Distribution">Distribution</a></dt><dd>Types (distributions) that can be used to create a random instance of <code>T</code>.</dd><dt><a class="trait" href="trait.SampleString.html" title="trait rand::distr::SampleString">Sample<wbr>String</a></dt><dd>Sample or extend a <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a></dd></dl></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/distr/struct.Alphabetic.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.Alphabetic.html">../../../rand/distr/struct.Alphabetic.html</a>...</p>
<script>location.replace("../../../rand/distr/struct.Alphabetic.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/distr/struct.Alphanumeric.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/distr/struct.Alphanumeric.html">../../../rand/distr/struct.Alphanumeric.html</a>...</p>
<script>location.replace("../../../rand/distr/struct.Alphanumeric.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["BernoulliError"],"mod":["slice","uniform","weighted"],"struct":["Alphabetic","Alphanumeric","Bernoulli","Iter","Map","Open01","OpenClosed01","StandardUniform","Uniform"],"trait":["Distribution","SampleString"]};

View File

@@ -0,0 +1,2 @@
<!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="Distributions over slices"><title>rand::distr::slice - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module slice</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module slice</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rand::<wbr>distr</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">distr</a></div><h1>Module <span>slice</span>&nbsp;<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/distr/slice.rs.html#9-167">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Distributions over slices</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Choose.html" title="struct rand::distr::slice::Choose">Choose</a></dt><dd>A distribution to uniformly sample elements of a slice</dd><dt><a class="struct" href="struct.Empty.html" title="struct rand::distr::slice::Empty">Empty</a></dt><dd>Error: empty slice</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Choose","Empty"]};

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

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,27 @@
<!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="Sample or extend a `String`"><title>SampleString in rand::distr - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">SampleString</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Sample<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>distr</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rand</a>::<wbr><a href="index.html">distr</a></div><h1>Trait <span class="trait">Sample<wbr>String</span>&nbsp;<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/distr/distribution.rs.html#183-202">Source</a> </span></div><pre class="rust item-decl"><code>pub trait SampleString {
// 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.93.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.93.1/std/primitive.reference.html">&amp;mut R</a>,
string: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
len: <a class="primitive" href="https://doc.rust-lang.org/1.93.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.93.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.93.1/std/primitive.reference.html">&amp;mut R</a>, len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.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>Sample or extend a <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a></p>
<p>Helper methods to extend a <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> or sample a new <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>.</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/distr/distribution.rs.html#189">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.93.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.93.1/std/primitive.reference.html">&amp;mut R</a>,
string: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
len: <a class="primitive" href="https://doc.rust-lang.org/1.93.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>
<p>Note: implementations may leave <code>string</code> with excess capacity. If this
is undesirable, consider calling <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html#method.shrink_to_fit" title="method alloc::string::String::shrink_to_fit"><code>String::shrink_to_fit</code></a> after this
method.</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/distr/distribution.rs.html#197-201">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.93.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.93.1/std/primitive.reference.html">&amp;mut R</a>, len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Generate a <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> of <code>len</code> random chars</p>
<p>Note: implementations may leave the string with excess capacity. If this
is undesirable, consider calling <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html#method.shrink_to_fit" title="method alloc::string::String::shrink_to_fit"><code>String::shrink_to_fit</code></a> after this
method.</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.93.1/reference/items/traits.html#dyn-compatibility">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-SampleString-for-Choose%3C'_,+char%3E" class="impl"><a class="src rightside" href="../../src/rand/distr/slice.rs.html#122-153">Source</a><a href="#impl-SampleString-for-Choose%3C'_,+char%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.SampleString.html" title="trait rand::distr::SampleString">SampleString</a> for <a class="struct" href="slice/struct.Choose.html" title="struct rand::distr::slice::Choose">Choose</a>&lt;'_, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.char.html">char</a>&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>alloc</code></strong> only.</div></span></section><section id="impl-SampleString-for-Alphabetic" class="impl"><a class="src rightside" href="../../src/rand/distr/other.rs.html#183-194">Source</a><a href="#impl-SampleString-for-Alphabetic" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.SampleString.html" title="trait rand::distr::SampleString">SampleString</a> for <a class="struct" href="struct.Alphabetic.html" title="struct rand::distr::Alphabetic">Alphabetic</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>alloc</code></strong> only.</div></span></section><section id="impl-SampleString-for-Alphanumeric" class="impl"><a class="src rightside" href="../../src/rand/distr/other.rs.html#168-180">Source</a><a href="#impl-SampleString-for-Alphanumeric" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.SampleString.html" title="trait rand::distr::SampleString">SampleString</a> for <a class="struct" href="struct.Alphanumeric.html" title="struct rand::distr::Alphanumeric">Alphanumeric</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>alloc</code></strong> only.</div></span></section><section id="impl-SampleString-for-StandardUniform" class="impl"><a class="src rightside" href="../../src/rand/distr/other.rs.html#127-135">Source</a><a href="#impl-SampleString-for-StandardUniform" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.SampleString.html" title="trait rand::distr::SampleString">SampleString</a> for <a class="struct" href="struct.StandardUniform.html" title="struct rand::distr::StandardUniform">StandardUniform</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>alloc</code></strong> only.</div></span></section><section id="impl-SampleString-for-Uniform%3Cchar%3E" class="impl"><a class="src rightside" href="../../src/rand/distr/uniform_other.rs.html#94-111">Source</a><a href="#impl-SampleString-for-Uniform%3Cchar%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.SampleString.html" title="trait rand::distr::SampleString">SampleString</a> for <a class="struct" href="struct.Uniform.html" title="struct rand::distr::Uniform">Uniform</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.char.html">char</a>&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>alloc</code></strong> only.</div></span></section></div><script src="../../trait.impl/rand/distr/distribution/trait.SampleString.js" async></script></section></div></main></body></html>

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/distr/uniform/struct.UniformFloat.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../rand/distr/uniform/struct.UniformFloat.html">../../../../rand/distr/uniform/struct.UniformFloat.html</a>...</p>
<script>location.replace("../../../../rand/distr/uniform/struct.UniformFloat.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,70 @@
<!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::distr::uniform - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module uniform</a></h2></rustdoc-topbar><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.9.2</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="#enums" title="Enums">Enums</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>distr</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">distr</a></div><h1>Module <span>uniform</span>&nbsp;<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/distr/uniform.rs.html#10-622">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::distr::Uniform"><code>Uniform</code></a> is the standard distribution to sample uniformly from a range;
e.g. <code>Uniform::new_inclusive(1, 6).unwrap()</code> can sample integers from 1 to 6, like a
standard die. <a href="../../trait.Rng.html#method.random_range" title="method rand::Rng::random_range"><code>Rng::random_range</code></a> is implemented over <a href="../struct.Uniform.html" title="struct rand::distr::Uniform"><code>Uniform</code></a>.</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;
<span class="kw">use </span>rand::distr::Uniform;
<span class="kw">let </span><span class="kw-2">mut </span>rng = rand::rng();
<span class="kw">let </span>side = Uniform::new(-<span class="number">10.0</span>, <span class="number">10.0</span>).unwrap();
<span class="comment">// sample between 1 and 10 points
</span><span class="kw">for _ in </span><span class="number">0</span>..rng.random_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::distr::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::distr::uniform::UniformSampler"><code>UniformSampler</code></a> trait, then implement the <a href="trait.SampleUniform.html" title="trait rand::distr::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 assertion 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>, <code>sample_single</code> and <code>sample_single_inclusive</code>
functions use arguments of
type <code>SampleBorrow&lt;X&gt;</code> 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::distr::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::distr::uniform::{Uniform, SampleUniform,
UniformSampler, UniformFloat, SampleBorrow, Error};
<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="prelude-ty">Result</span>&lt;<span class="self">Self</span>, Error&gt;
<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
{
UniformFloat::&lt;f32&gt;::new(low.borrow().<span class="number">0</span>, high.borrow().<span class="number">0</span>).map(UniformMyF32)
}
<span class="kw">fn </span>new_inclusive&lt;B1, B2&gt;(low: B1, high: B2) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, Error&gt;
<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
{
UniformFloat::&lt;f32&gt;::new_inclusive(low.borrow().<span class="number">0</span>, high.borrow().<span class="number">0</span>).map(UniformMyF32)
}
<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).unwrap();
<span class="kw">let </span>x = uniform.sample(<span class="kw-2">&amp;mut </span>rand::rng());</code></pre></div></div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Uniform.html" title="struct rand::distr::uniform::Uniform">Uniform</a></dt><dd>Sample values uniformly between two bounds.</dd><dt><a class="struct" href="struct.UniformChar.html" title="struct rand::distr::uniform::UniformChar">Uniform<wbr>Char</a></dt><dd>The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler"><code>UniformSampler</code></a> for <code>char</code>.</dd><dt><a class="struct" href="struct.UniformDuration.html" title="struct rand::distr::uniform::UniformDuration">Uniform<wbr>Duration</a></dt><dd>The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler"><code>UniformSampler</code></a> for <code>Duration</code>.</dd><dt><a class="struct" href="struct.UniformFloat.html" title="struct rand::distr::uniform::UniformFloat">Uniform<wbr>Float</a></dt><dd>The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler"><code>UniformSampler</code></a> for floating-point types.</dd><dt><a class="struct" href="struct.UniformInt.html" title="struct rand::distr::uniform::UniformInt">Uniform<wbr>Int</a></dt><dd>The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler"><code>UniformSampler</code></a> for integer types.</dd><dt><a class="struct" href="struct.UniformUsize.html" title="struct rand::distr::uniform::UniformUsize">Uniform<wbr>Usize</a></dt><dd>The back-end implementing <a href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler"><code>UniformSampler</code></a> for <code>usize</code>.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Error.html" title="enum rand::distr::uniform::Error">Error</a></dt><dd>Error type returned from <a href="../struct.Uniform.html#method.new" title="associated function rand::distr::Uniform::new"><code>Uniform::new</code></a> and <code>new_inclusive</code>.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.SampleBorrow.html" title="trait rand::distr::uniform::SampleBorrow">Sample<wbr>Borrow</a></dt><dd>Helper trait similar to <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow"><code>Borrow</code></a> but implemented
only for <a href="trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform"><code>SampleUniform</code></a> and references to <a href="trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform"><code>SampleUniform</code></a>
in order to resolve ambiguity issues.</dd><dt><a class="trait" href="trait.SampleRange.html" title="trait rand::distr::uniform::SampleRange">Sample<wbr>Range</a></dt><dd>Range that supports generating a single sample efficiently.</dd><dt><a class="trait" href="trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform">Sample<wbr>Uniform</a></dt><dd>Helper trait for creating objects using the correct implementation of
<a href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler"><code>UniformSampler</code></a> for the sampling type.</dd><dt><a class="trait" href="trait.UniformSampler.html" title="trait rand::distr::uniform::UniformSampler">Uniform<wbr>Sampler</a></dt><dd>Helper trait handling actual uniform sampling.</dd></dl></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/distr/uniform/struct.UniformInt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../rand/distr/uniform/struct.UniformInt.html">../../../../rand/distr/uniform/struct.UniformInt.html</a>...</p>
<script>location.replace("../../../../rand/distr/uniform/struct.UniformInt.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/distr/uniform/struct.UniformUsize.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../rand/distr/uniform/struct.UniformUsize.html">../../../../rand/distr/uniform/struct.UniformUsize.html</a>...</p>
<script>location.replace("../../../../rand/distr/uniform/struct.UniformUsize.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/distr/uniform/struct.UniformChar.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../rand/distr/uniform/struct.UniformChar.html">../../../../rand/distr/uniform/struct.UniformChar.html</a>...</p>
<script>location.replace("../../../../rand/distr/uniform/struct.UniformChar.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/distr/uniform/struct.UniformDuration.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../rand/distr/uniform/struct.UniformDuration.html">../../../../rand/distr/uniform/struct.UniformDuration.html</a>...</p>
<script>location.replace("../../../../rand/distr/uniform/struct.UniformDuration.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["Uniform","UniformChar","UniformDuration","UniformFloat","UniformInt","UniformUsize"],"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

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::distr::uniform - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">SampleBorrow</a></h2></rustdoc-topbar><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.9.2</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;Borrowed">&#38;Borrowed</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>distr::<wbr>uniform</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">distr</a>::<wbr><a href="index.html">uniform</a></div><h1>Trait <span class="trait">Sample<wbr>Borrow</span>&nbsp;<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/distr/uniform.rs.html#393-398">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.93.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.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow"><code>Borrow</code></a> but implemented
only for <a href="trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform"><code>SampleUniform</code></a> and references to <a href="trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform"><code>SampleUniform</code></a>
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/distr/uniform.rs.html#397">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.93.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.93.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/distr/uniform.rs.html#408-416">Source</a><a href="#impl-SampleBorrow%3CBorrowed%3E-for-%26Borrowed" class="anchor">§</a><h3 class="code-header">impl&lt;Borrowed&gt; <a class="trait" href="trait.SampleBorrow.html" title="trait rand::distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Borrowed&gt; for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;Borrowed</a><div class="where">where
Borrowed: <a class="trait" href="trait.SampleUniform.html" title="trait rand::distr::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/distr/uniform.rs.html#413-415">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.93.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/distr/uniform.rs.html#399-407">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::distr::uniform::SampleBorrow">SampleBorrow</a>&lt;Borrowed&gt; for Borrowed<div class="where">where
Borrowed: <a class="trait" href="trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform">SampleUniform</a>,</div></h3></section></div><script src="../../../trait.impl/rand/distr/uniform/trait.SampleBorrow.js" 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

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,5 @@
<!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::distr::weighted - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module weighted</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module weighted</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="#enums" title="Enums">Enums</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>distr</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">distr</a></div><h1>Module <span>weighted</span>&nbsp;<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/distr/weighted/mod.rs.html#9-115">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Weighted (index) sampling</p>
<p>Primarily, this module houses the <a href="struct.WeightedIndex.html" title="struct rand::distr::weighted::WeightedIndex"><code>WeightedIndex</code></a> distribution.
See also <a href="https://docs.rs/rand_distr/latest/rand_distr/weighted/index.html"><code>rand_distr::weighted</code></a> for alternative implementations supporting
potentially-faster sampling or a more easily modifiable tree structure.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.WeightedIndex.html" title="struct rand::distr::weighted::WeightedIndex">Weighted<wbr>Index</a></dt><dd>A distribution using weighted sampling of discrete items.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Error.html" title="enum rand::distr::weighted::Error">Error</a></dt><dd>Invalid weight errors</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Weight.html" title="trait rand::distr::weighted::Weight">Weight</a></dt><dd>Bounds on a weight</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Error"],"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,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../rand/distr/weighted/struct.WeightedIndex.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../rand/distr/weighted/struct.WeightedIndex.html">../../../../rand/distr/weighted/struct.WeightedIndex.html</a>...</p>
<script>location.replace("../../../../rand/distr/weighted/struct.WeightedIndex.html" + location.search + location.hash);</script>
</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="Fill any type implementing `Fill` with random data"><title>fill in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">fill</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">fill</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">fill</span>&nbsp;<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/lib.rs.html#296-298">Source</a> </span></div><pre class="rust item-decl"><code>pub fn fill&lt;T: <a class="trait" href="trait.Fill.html" title="trait rand::Fill">Fill</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(dest: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Fill any type implementing <a href="trait.Fill.html" title="trait rand::Fill"><code>Fill</code></a> with random data</p>
<p>This function is shorthand for
<code><a href="fn.rng.html" title="fn rand::rng">rng()</a>.<a href="trait.Rng.html#method.fill" title="method rand::Rng::fill">fill</a>(<var>dest</var>)</code>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>arr = [<span class="number">0i8</span>; <span class="number">20</span>];
rand::fill(<span class="kw-2">&amp;mut </span>arr[..]);</code></pre></div>
<p>Note that you can instead use <a href="fn.random.html" title="fn rand::random"><code>random()</code></a> to generate an array of random
data, though this is slower for small elements (smaller than the RNG word
size).</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,29 @@
<!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="Generate a random value using the thread-local random number generator."><title>random in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">random</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">random</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">random</span>&nbsp;<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/lib.rs.html#172-177">Source</a> </span></div><pre class="rust item-decl"><code>pub fn random&lt;T&gt;() -&gt; T<div class="where">where
<a class="struct" href="distr/struct.StandardUniform.html" title="struct rand::distr::StandardUniform">StandardUniform</a>: <a class="trait" href="distr/trait.Distribution.html" title="trait rand::distr::Distribution">Distribution</a>&lt;T&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Generate a random value using the thread-local random number generator.</p>
<p>This function is shorthand for <code><a href="fn.rng.html" title="fn rand::rng">rng()</a>.<a href="trait.Rng.html#method.random" title="method rand::Rng::random">random()</a></code>:</p>
<ul>
<li>See <a href="rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng"><code>ThreadRng</code></a> for documentation of the generator and security</li>
<li>See <a href="distr/struct.StandardUniform.html" title="struct rand::distr::StandardUniform"><code>StandardUniform</code></a> for documentation of supported types and distributions</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = rand::random::&lt;u8&gt;();
<span class="macro">println!</span>(<span class="string">"{}"</span>, x);
<span class="kw">let </span>y = rand::random::&lt;f64&gt;();
<span class="macro">println!</span>(<span class="string">"{}"</span>, y);
<span class="kw">if </span>rand::random() { <span class="comment">// generates a boolean
</span><span class="macro">println!</span>(<span class="string">"Better lucky than good!"</span>);
}</code></pre></div>
<p>If youre calling <code>random()</code> repeatedly, consider using a local <code>rng</code>
handle to save an initialization-check on each usage:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand::Rng; <span class="comment">// provides the `random` method
</span><span class="kw">let </span><span class="kw-2">mut </span>rng = rand::rng(); <span class="comment">// a local handle to the generator
</span><span class="kw">let </span><span class="kw-2">mut </span>v = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
<span class="kw">for </span>x <span class="kw">in </span>v.iter_mut() {
<span class="kw-2">*</span>x = rng.random();
}</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,7 @@
<!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="Return a bool with a probability `p` of being true."><title>random_bool in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">random_bool</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">random_<wbr>bool</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li><li><a href="#panics" title="Panics">Panics</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">random_<wbr>bool</span>&nbsp;<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/lib.rs.html#242-244">Source</a> </span></div><pre class="rust item-decl"><code>pub fn random_bool(p: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.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>Return a bool with a probability <code>p</code> of being true.</p>
<p>This function is shorthand for
<code><a href="fn.rng.html" title="fn rand::rng">rng()</a>.<a href="trait.Rng.html#method.random_bool" title="method rand::Rng::random_bool">random_bool</a>(<var>p</var>)</code>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, rand::random_bool(<span class="number">1.0 </span>/ <span class="number">3.0</span>));</code></pre></div><h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>If <code>p &lt; 0</code> or <code>p &gt; 1</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,7 @@
<!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="Return an iterator over `random()` variates"><title>random_iter in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">random_iter</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">random_<wbr>iter</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">random_<wbr>iter</span>&nbsp;<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/lib.rs.html#192-197">Source</a> </span></div><pre class="rust item-decl"><code>pub fn random_iter&lt;T&gt;() -&gt; <a class="struct" href="distr/struct.Iter.html" title="struct rand::distr::Iter">Iter</a>&lt;<a class="struct" href="distr/struct.StandardUniform.html" title="struct rand::distr::StandardUniform">StandardUniform</a>, <a class="struct" href="rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng">ThreadRng</a>, T&gt; <a href="#" class="tooltip" data-notable-ty="Iter&lt;StandardUniform, ThreadRng, T&gt;"></a><div class="where">where
<a class="struct" href="distr/struct.StandardUniform.html" title="struct rand::distr::StandardUniform">StandardUniform</a>: <a class="trait" href="distr/trait.Distribution.html" title="trait rand::distr::Distribution">Distribution</a>&lt;T&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Return an iterator over <a href="fn.random.html" title="fn rand::random"><code>random()</code></a> variates</p>
<p>This function is shorthand for
<code><a href="fn.rng.html" title="fn rand::rng">rng()</a>.<a href="trait.Rng.html#method.random_iter" title="method rand::Rng::random_iter">random_iter</a>()</code>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec&lt;i32&gt; = rand::random_iter().take(<span class="number">5</span>).collect();
<span class="macro">println!</span>(<span class="string">"{v:?}"</span>);</code></pre></div></div></details><script type="text/json" id="notable-traits-data">{"Iter<StandardUniform, ThreadRng, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"distr/struct.Iter.html\" title=\"struct rand::distr::Iter\">Iter</a>&lt;D, R, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;D, R, T&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"distr/struct.Iter.html\" title=\"struct rand::distr::Iter\">Iter</a>&lt;D, R, T&gt;<div class=\"where\">where\n D: <a class=\"trait\" href=\"distr/trait.Distribution.html\" title=\"trait rand::distr::Distribution\">Distribution</a>&lt;T&gt;,\n R: <a class=\"trait\" href=\"trait.Rng.html\" title=\"trait rand::Rng\">Rng</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = T;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,14 @@
<!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="Generate a random value in the given range using the thread-local random number generator."><title>random_range in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">random_range</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">random_<wbr>range</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">random_<wbr>range</span>&nbsp;<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/lib.rs.html#217-223">Source</a> </span></div><pre class="rust item-decl"><code>pub fn random_range&lt;T, R&gt;(range: R) -&gt; T<div class="where">where
T: <a class="trait" href="distr/uniform/trait.SampleUniform.html" title="trait rand::distr::uniform::SampleUniform">SampleUniform</a>,
R: <a class="trait" href="distr/uniform/trait.SampleRange.html" title="trait rand::distr::uniform::SampleRange">SampleRange</a>&lt;T&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Generate a random value in the given range using the thread-local random number generator.</p>
<p>This function is shorthand for
<code><a href="fn.rng.html" title="fn rand::rng">rng()</a>.<a href="trait.Rng.html#method.random_range" title="method rand::Rng::random_range">random_range</a>(<var>range</var>)</code>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>y: f32 = rand::random_range(<span class="number">0.0</span>..=<span class="number">1e9</span>);
<span class="macro">println!</span>(<span class="string">"{}"</span>, y);
<span class="kw">let </span>words: Vec&lt;<span class="kw-2">&amp;</span>str&gt; = <span class="string">"Mary had a little lamb"</span>.split(<span class="string">' '</span>).collect();
<span class="macro">println!</span>(<span class="string">"{}"</span>, words[rand::random_range(..words.len())]);</code></pre></div>
<p>Note that the first example can also be achieved (without <code>collect</code>ing
to a <code>Vec</code>) using <a href="seq/trait.IteratorRandom.html#method.choose" title="method rand::seq::IteratorRandom::choose"><code>seq::IteratorRandom::choose</code></a>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,14 @@
<!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="Return a bool with a probability of `numerator/denominator` of being true."><title>random_ratio in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">random_ratio</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">random_<wbr>ratio</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li><li><a href="#example" title="Example">Example</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">random_<wbr>ratio</span>&nbsp;<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/lib.rs.html#274-276">Source</a> </span></div><pre class="rust item-decl"><code>pub fn random_ratio(numerator: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, denominator: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.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>Return a bool with a probability of <code>numerator/denominator</code> of being
true.</p>
<p>That is, <code>random_ratio(2, 3)</code> has chance of 2 in 3, or about 67%, of
returning true. If <code>numerator == denominator</code>, then the returned value
is guaranteed to be <code>true</code>. If <code>numerator == 0</code>, then the returned
value is guaranteed to be <code>false</code>.</p>
<p>See also the <a href="distr/struct.Bernoulli.html" title="struct rand::distr::Bernoulli"><code>Bernoulli</code></a> distribution, which may be faster if
sampling from the same <code>numerator</code> and <code>denominator</code> repeatedly.</p>
<p>This function is shorthand for
<code><a href="fn.rng.html" title="fn rand::rng">rng()</a>.<a href="trait.Rng.html#method.random_ratio" title="method rand::Rng::random_ratio">random_ratio</a>(<var>numerator</var>, <var>denominator</var>)</code>.</p>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>If <code>denominator == 0</code> or <code>numerator &gt; denominator</code>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, rand::random_ratio(<span class="number">2</span>, <span class="number">3</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,18 @@
<!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="Access a fast, pre-initialized generator"><title>rng in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">rng</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">rng</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li><li><a href="#security" title="Security">Security</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">rng</span>&nbsp;<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/rngs/thread.rs.html#157-160">Source</a> </span></div><pre class="rust item-decl"><code>pub fn rng() -&gt; <a class="struct" href="rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng">ThreadRng</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Access a fast, pre-initialized generator</p>
<p>This is a handle to the local <a href="rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng"><code>ThreadRng</code></a>.</p>
<p>See also <a href="rngs/index.html" title="mod rand::rngs"><code>crate::rngs</code></a> for alternatives.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand::prelude::<span class="kw-2">*</span>;
<span class="kw">let </span><span class="kw-2">mut </span>numbers = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>];
numbers.shuffle(<span class="kw-2">&amp;mut </span>rand::rng());
<span class="macro">println!</span>(<span class="string">"Numbers: {numbers:?}"</span>);
<span class="comment">// Using a local binding avoids an initialization-check on each usage:
</span><span class="kw">let </span><span class="kw-2">mut </span>rng = rand::rng();
<span class="macro">println!</span>(<span class="string">"True or false: {}"</span>, rng.random::&lt;bool&gt;());
<span class="macro">println!</span>(<span class="string">"A simulated die roll: {}"</span>, rng.random_range(<span class="number">1</span>..=<span class="number">6</span>));</code></pre></div><h2 id="security"><a class="doc-anchor" href="#security">§</a>Security</h2>
<p>Refer to <a href="rngs/struct.ThreadRng.html#Security" title="struct rand::rngs::ThreadRng"><code>ThreadRng</code></a>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,3 @@
<!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="Access the thread-local generator"><title>thread_rng in rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">thread_rng</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rand</a></div><h1>Function <span class="fn">thread_<wbr>rng</span>&nbsp;<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/lib.rs.html#123-125">Source</a> </span></div><pre class="rust item-decl"><code>pub fn thread_rng() -&gt; <a class="struct" href="rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng">ThreadRng</a></code></pre><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.9.0: Renamed to <code>rng</code></span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Access the thread-local generator</p>
<p>Use <a href="fn.rng.html" title="fn rand::rng"><code>rand::rng()</code></a> instead.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,25 @@
<!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="Utilities for random number generation"><title>rand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate rand</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#quick-start" title="Quick Start">Quick Start</a></li><li><a href="#the-book" title="The Book">The Book</a></li></ul><h3><a href="#reexports">Crate 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><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>rand</span>&nbsp;<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/lib.rs.html#10-360">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities for random number generation</p>
<p>Rand provides utilities to generate random numbers, to convert them to
useful types and distributions, and some randomness-related algorithms.</p>
<h2 id="quick-start"><a class="doc-anchor" href="#quick-start">§</a>Quick Start</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// The prelude import enables methods we use below, specifically
// Rng::random, Rng::sample, SliceRandom::shuffle and IndexedRandom::choose.
</span><span class="kw">use </span>rand::prelude::<span class="kw-2">*</span>;
<span class="comment">// Get an RNG:
</span><span class="kw">let </span><span class="kw-2">mut </span>rng = rand::rng();
<span class="comment">// Try printing a random unicode code point (probably a bad idea)!
</span><span class="macro">println!</span>(<span class="string">"char: '{}'"</span>, rng.random::&lt;char&gt;());
<span class="comment">// Try printing a random alphanumeric value instead!
</span><span class="macro">println!</span>(<span class="string">"alpha: '{}'"</span>, rng.sample(rand::distr::Alphanumeric) <span class="kw">as </span>char);
<span class="comment">// Generate and shuffle a sequence:
</span><span class="kw">let </span><span class="kw-2">mut </span>nums: Vec&lt;i32&gt; = (<span class="number">1</span>..<span class="number">100</span>).collect();
nums.shuffle(<span class="kw-2">&amp;mut </span>rng);
<span class="comment">// And take a random pick (yes, we didn't need to shuffle first!):
</span><span class="kw">let _ </span>= nums.choose(<span class="kw-2">&amp;mut </span>rng);</code></pre></div><h2 id="the-book"><a class="doc-anchor" href="#the-book">§</a>The Book</h2>
<p>For the user guide and further documentation, please read
<a href="https://rust-random.github.io/book">The Rust Rand Book</a>.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.rand_core"><code>pub use <a class="mod" href="../rand_core/index.html" title="mod rand_core">rand_core</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="distr/index.html" title="mod rand::distr">distr</a></dt><dd>Generating random samples from probability distributions</dd><dt><a class="mod" href="prelude/index.html" title="mod rand::prelude">prelude</a></dt><dd>Convenience re-export of common members</dd><dt><a class="mod" href="rngs/index.html" title="mod rand::rngs">rngs</a></dt><dd>Random number generators and adapters</dd><dt><a class="mod" href="seq/index.html" title="mod rand::seq">seq</a></dt><dd>Sequence-related functionality</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.CryptoRng.html" title="trait rand::CryptoRng">Crypto<wbr>Rng</a></dt><dd>A marker trait over <a href="trait.RngCore.html" title="trait rand::RngCore"><code>RngCore</code></a> for securely unpredictable RNGs</dd><dt><a class="trait" href="trait.Fill.html" title="trait rand::Fill">Fill</a></dt><dd>Types which may be filled with random data</dd><dt><a class="trait" href="trait.Rng.html" title="trait rand::Rng">Rng</a></dt><dd>User-level interface for RNGs</dd><dt><a class="trait" href="trait.RngCore.html" title="trait rand::RngCore">RngCore</a></dt><dd>Implementation-level interface for RNGs</dd><dt><a class="trait" href="trait.SeedableRng.html" title="trait rand::SeedableRng">Seedable<wbr>Rng</a></dt><dd>A random number generator that can be explicitly seeded.</dd><dt><a class="trait" href="trait.TryCryptoRng.html" title="trait rand::TryCryptoRng">TryCrypto<wbr>Rng</a></dt><dd>A marker trait over <a href="trait.TryRngCore.html" title="trait rand::TryRngCore"><code>TryRngCore</code></a> for securely unpredictable RNGs</dd><dt><a class="trait" href="trait.TryRngCore.html" title="trait rand::TryRngCore">TryRng<wbr>Core</a></dt><dd>A potentially fallible variant of <a href="trait.RngCore.html" title="trait rand::RngCore"><code>RngCore</code></a></dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.fill.html" title="fn rand::fill">fill</a></dt><dd>Fill any type implementing <a href="trait.Fill.html" title="trait rand::Fill"><code>Fill</code></a> with random data</dd><dt><a class="fn" href="fn.random.html" title="fn rand::random">random</a></dt><dd>Generate a random value using the thread-local random number generator.</dd><dt><a class="fn" href="fn.random_bool.html" title="fn rand::random_bool">random_<wbr>bool</a></dt><dd>Return a bool with a probability <code>p</code> of being true.</dd><dt><a class="fn" href="fn.random_iter.html" title="fn rand::random_iter">random_<wbr>iter</a></dt><dd>Return an iterator over <a href="fn.random.html" title="fn rand::random"><code>random()</code></a> variates</dd><dt><a class="fn" href="fn.random_range.html" title="fn rand::random_range">random_<wbr>range</a></dt><dd>Generate a random value in the given range using the thread-local random number generator.</dd><dt><a class="fn" href="fn.random_ratio.html" title="fn rand::random_ratio">random_<wbr>ratio</a></dt><dd>Return a bool with a probability of <code>numerator/denominator</code> of being
true.</dd><dt><a class="fn" href="fn.rng.html" title="fn rand::rng">rng</a></dt><dd>Access a fast, pre-initialized generator</dd><dt><a class="fn" href="fn.thread_rng.html" title="fn rand::thread_rng">thread_<wbr>rng</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Access the thread-local generator</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Convenience re-export of common members"><title>rand::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module prelude</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module prelude</a></h2><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rand</a></div><h1>Module <span>prelude</span>&nbsp;<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/prelude.rs.html#9-35">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Convenience re-export of common members</p>
<p>Like the standard librarys prelude, this module simplifies importing of
common items. Unlike the standard prelude, the contents of this module must
be imported manually:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand::prelude::<span class="kw-2">*</span>;</code></pre></div></div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.Distribution"><code>pub use crate::distr::<a class="trait" href="../distr/trait.Distribution.html" title="trait rand::distr::Distribution">Distribution</a>;</code></dt><dt id="reexport.SmallRng"><code>pub use crate::rngs::<a class="struct" href="../rngs/struct.SmallRng.html" title="struct rand::rngs::SmallRng">SmallRng</a>;</code></dt><dt id="reexport.StdRng"><code>pub use crate::rngs::<a class="struct" href="../rngs/struct.StdRng.html" title="struct rand::rngs::StdRng">StdRng</a>;</code></dt><dt id="reexport.ThreadRng"><code>pub use crate::rngs::<a class="struct" href="../rngs/struct.ThreadRng.html" title="struct rand::rngs::ThreadRng">ThreadRng</a>;</code></dt><dt id="reexport.IndexedMutRandom"><code>pub use crate::seq::<a class="trait" href="../seq/trait.IndexedMutRandom.html" title="trait rand::seq::IndexedMutRandom">IndexedMutRandom</a>;</code></dt><dt id="reexport.IndexedRandom"><code>pub use crate::seq::<a class="trait" href="../seq/trait.IndexedRandom.html" title="trait rand::seq::IndexedRandom">IndexedRandom</a>;</code></dt><dt id="reexport.IteratorRandom"><code>pub use crate::seq::<a class="trait" href="../seq/trait.IteratorRandom.html" title="trait rand::seq::IteratorRandom">IteratorRandom</a>;</code></dt><dt id="reexport.SliceRandom"><code>pub use crate::seq::<a class="trait" href="../seq/trait.SliceRandom.html" title="trait rand::seq::SliceRandom">SliceRandom</a>;</code></dt><dt id="reexport.CryptoRng"><code>pub use crate::<a class="trait" href="../trait.CryptoRng.html" title="trait rand::CryptoRng">CryptoRng</a>;</code></dt><dt id="reexport.Rng"><code>pub use crate::<a class="trait" href="../trait.Rng.html" title="trait rand::Rng">Rng</a>;</code></dt><dt id="reexport.RngCore"><code>pub use crate::<a class="trait" href="../trait.RngCore.html" title="trait rand::RngCore">RngCore</a>;</code></dt><dt id="reexport.SeedableRng"><code>pub use crate::<a class="trait" href="../trait.SeedableRng.html" title="trait rand::SeedableRng">SeedableRng</a>;</code></dt></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {};

View File

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

View File

@@ -0,0 +1,46 @@
<!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="Random number generators and adapters"><title>rand::rngs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module rngs</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module rngs</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#generators" title="Generators">Generators</a><ul><li><a href="#additional-generators" title="Additional generators">Additional generators</a></li></ul></li><li><a href="#traits-and-functionality" title="Traits and functionality">Traits and functionality</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></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" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rand</a></div><h1>Module <span>rngs</span>&nbsp;<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/rngs/mod.rs.html#9-110">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Random number generators and adapters</p>
<p>This crate provides a small selection of non-<a href="https://rust-random.github.io/book/crate-reprod.html">portable</a> generators.
See also <a href="https://rust-random.github.io/book/guide-gen.html">Types of generators</a> and <a href="https://rust-random.github.io/book/guide-rngs.html">Our RNGs</a> in the book.</p>
<h3 id="generators"><a class="doc-anchor" href="#generators">§</a>Generators</h3>
<p>This crate provides a small selection of non-<a href="https://rust-random.github.io/book/crate-reprod.html">portable</a> random number generators:</p>
<ul>
<li><a href="struct.OsRng.html" title="struct rand::rngs::OsRng"><code>OsRng</code></a> is a stateless interface over the operating systems random number
source. This is typically secure with some form of periodic re-seeding.</li>
<li><a href="struct.ThreadRng.html" title="struct rand::rngs::ThreadRng"><code>ThreadRng</code></a>, provided by <a href="../fn.rng.html" title="fn rand::rng"><code>crate::rng()</code></a>, is a handle to a
thread-local generator with periodic seeding from <a href="struct.OsRng.html" title="struct rand::rngs::OsRng"><code>OsRng</code></a>. Because this
is local, it is typically much faster than <a href="struct.OsRng.html" title="struct rand::rngs::OsRng"><code>OsRng</code></a>. It should be
secure, but see documentation on <a href="struct.ThreadRng.html" title="struct rand::rngs::ThreadRng"><code>ThreadRng</code></a>.</li>
<li><a href="struct.StdRng.html" title="struct rand::rngs::StdRng"><code>StdRng</code></a> is a CSPRNG chosen for good performance and trust of security
(based on reviews, maturity and usage). The current algorithm is ChaCha12,
which is well established and rigorously analysed.
<a href="struct.StdRng.html" title="struct rand::rngs::StdRng"><code>StdRng</code></a> is the deterministic generator used by <a href="struct.ThreadRng.html" title="struct rand::rngs::ThreadRng"><code>ThreadRng</code></a> but
without the periodic reseeding or thread-local management.</li>
<li><a href="struct.SmallRng.html" title="struct rand::rngs::SmallRng"><code>SmallRng</code></a> is a relatively simple, insecure generator designed to be
fast, use little memory, and pass various statistical tests of
randomness quality.</li>
</ul>
<p>The algorithms selected for <a href="struct.StdRng.html" title="struct rand::rngs::StdRng"><code>StdRng</code></a> and <a href="struct.SmallRng.html" title="struct rand::rngs::SmallRng"><code>SmallRng</code></a> may change in any
release and may be platform-dependent, therefore they are not
<a href="https://rust-random.github.io/book/crate-reprod.html">reproducible</a>.</p>
<h4 id="additional-generators"><a class="doc-anchor" href="#additional-generators">§</a>Additional generators</h4>
<ul>
<li>The <a href="https://crates.io/crates/rdrand"><code>rdrand</code></a> crate provides an interface to the RDRAND and RDSEED
instructions available in modern Intel and AMD CPUs.</li>
<li>The <a href="https://crates.io/crates/rand_jitter"><code>rand_jitter</code></a> crate provides a user-space implementation of
entropy harvesting from CPU timer jitter, but is very slow and has
<a href="https://github.com/rust-random/rand/issues/699">security issues</a>.</li>
<li>The <a href="https://crates.io/crates/rand_chacha"><code>rand_chacha</code></a> crate provides <a href="https://rust-random.github.io/book/crate-reprod.html">portable</a> implementations of
generators derived from the <a href="https://cr.yp.to/chacha.html">ChaCha</a> family of stream ciphers</li>
<li>The <a href="https://crates.io/crates/rand_pcg"><code>rand_pcg</code></a> crate provides <a href="https://rust-random.github.io/book/crate-reprod.html">portable</a> implementations of a subset
of the <a href="https://www.pcg-random.org/">PCG</a> family of small, insecure generators</li>
<li>The <a href="https://crates.io/crates/rand_xoshiro"><code>rand_xoshiro</code></a> crate provides <a href="https://rust-random.github.io/book/crate-reprod.html">portable</a> implementations of the
<a href="https://prng.di.unimi.it/">xoshiro</a> family of small, insecure generators</li>
</ul>
<p>For more, search <a href="https://crates.io/keywords/rng">crates with the <code>rng</code> tag</a>.</p>
<h3 id="traits-and-functionality"><a class="doc-anchor" href="#traits-and-functionality">§</a>Traits and functionality</h3>
<p>All generators implement <a href="../trait.RngCore.html" title="trait rand::RngCore"><code>RngCore</code></a> and thus also <a href="../trait.Rng.html" title="trait rand::Rng"><code>Rng</code></a>.
See also the <a href="https://rust-random.github.io/book/guide-values.html">Random Values</a> chapter in the book.</p>
<p>Secure RNGs may additionally implement the <a href="../trait.CryptoRng.html" title="trait rand::CryptoRng"><code>CryptoRng</code></a> trait.</p>
<p>Use the <a href="../../rand_core/index.html" title="mod rand_core"><code>rand_core</code></a> crate when implementing your own RNGs.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="mock/index.html" title="mod rand::rngs::mock">mock</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Mock random number generator</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.OsRng.html" title="struct rand::rngs::OsRng">OsRng</a></dt><dd>An interface over the operating-systems random data source</dd><dt><a class="struct" href="struct.ReseedingRng.html" title="struct rand::rngs::ReseedingRng">Reseeding<wbr>Rng</a></dt><dd>A wrapper around any PRNG that implements <a href="../../rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore"><code>BlockRngCore</code></a>, that adds the
ability to reseed it.</dd><dt><a class="struct" href="struct.SmallRng.html" title="struct rand::rngs::SmallRng">Small<wbr>Rng</a></dt><dd>A small-state, fast, non-crypto, non-portable PRNG</dd><dt><a class="struct" href="struct.StdRng.html" title="struct rand::rngs::StdRng">StdRng</a></dt><dd>A strong, fast (amortized), non-portable RNG</dd><dt><a class="struct" href="struct.ThreadRng.html" title="struct rand::rngs::ThreadRng">Thread<wbr>Rng</a></dt><dd>A reference to the thread-local generator</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="Mock random number generator"><title>rand::rngs::mock - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module mock</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module mock</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rand::<wbr>rngs</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">rngs</a></div><h1>Module <span>mock</span>&nbsp;<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/rngs/mock.rs.html#9-80">Source</a> </span></div><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.9.2</span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Mock random number generator</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.StepRng.html" title="struct rand::rngs::mock::StepRng">StepRng</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>A mock generator yielding very predictable output</dd></dl></section></div></main></body></html>

View File

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

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/rngs/struct.ReseedingRng.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/rngs/struct.ReseedingRng.html">../../../rand/rngs/struct.ReseedingRng.html</a>...</p>
<script>location.replace("../../../rand/rngs/struct.ReseedingRng.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["mock"],"struct":["OsRng","ReseedingRng","SmallRng","StdRng","ThreadRng"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/rngs/struct.SmallRng.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/rngs/struct.SmallRng.html">../../../rand/rngs/struct.SmallRng.html</a>...</p>
<script>location.replace("../../../rand/rngs/struct.SmallRng.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/rngs/struct.StdRng.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/rngs/struct.StdRng.html">../../../rand/rngs/struct.StdRng.html</a>...</p>
<script>location.replace("../../../rand/rngs/struct.StdRng.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

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/fn.rng.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/fn.rng.html">../../../rand/fn.rng.html</a>...</p>
<script>location.replace("../../../rand/fn.rng.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/rngs/struct.ThreadRng.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/rngs/struct.ThreadRng.html">../../../rand/rngs/struct.ThreadRng.html</a>...</p>
<script>location.replace("../../../rand/rngs/struct.ThreadRng.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<!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="Sequence-related functionality"><title>rand::seq - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module seq</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module seq</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><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate rand</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rand</a></div><h1>Module <span>seq</span>&nbsp;<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/seq/mod.rs.html#9-80">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Sequence-related functionality</p>
<p>This module provides:</p>
<ul>
<li><a href="trait.IndexedRandom.html" title="trait rand::seq::IndexedRandom"><code>IndexedRandom</code></a> for sampling slices and other indexable lists</li>
<li><a href="trait.IndexedMutRandom.html" title="trait rand::seq::IndexedMutRandom"><code>IndexedMutRandom</code></a> for sampling slices and other mutably indexable lists</li>
<li><a href="trait.SliceRandom.html" title="trait rand::seq::SliceRandom"><code>SliceRandom</code></a> for mutating slices</li>
<li><a href="trait.IteratorRandom.html" title="trait rand::seq::IteratorRandom"><code>IteratorRandom</code></a> for sampling iterators</li>
<li><a href="index/fn.sample.html" title="fn rand::seq::index::sample"><code>index::sample</code></a> low-level API to choose multiple indices from
<code>0..length</code></li>
</ul>
<p>Also see:</p>
<ul>
<li><a href="../distr/weighted/struct.WeightedIndex.html" title="struct rand::distr::weighted::WeightedIndex"><code>crate::distr::weighted::WeightedIndex</code></a> distribution which provides
weighted index sampling.</li>
</ul>
<p>In order to make results reproducible across 32-64 bit architectures, all
<code>usize</code> indices are sampled as a <code>u32</code> where possible (also providing a
small performance boost in some cases).</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.WeightError"><code>pub use crate::distr::weighted::<a class="enum" href="../distr/weighted/enum.Error.html" title="enum rand::distr::weighted::Error">Error</a> as WeightError;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="index/index.html" title="mod rand::seq::index">index</a></dt><dd>Low-level API for sampling indices</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.SliceChooseIter.html" title="struct rand::seq::SliceChooseIter">Slice<wbr>Choose<wbr>Iter</a></dt><dd>An iterator over multiple slice elements.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.IndexedMutRandom.html" title="trait rand::seq::IndexedMutRandom">Indexed<wbr>MutRandom</a></dt><dd>Extension trait on indexable lists, providing random sampling methods.</dd><dt><a class="trait" href="trait.IndexedRandom.html" title="trait rand::seq::IndexedRandom">Indexed<wbr>Random</a></dt><dd>Extension trait on indexable lists, providing random sampling methods.</dd><dt><a class="trait" href="trait.IteratorRandom.html" title="trait rand::seq::IteratorRandom">Iterator<wbr>Random</a></dt><dd>Extension trait on iterators, providing random sampling methods.</dd><dt><a class="trait" href="trait.SliceRandom.html" title="trait rand::seq::SliceRandom">Slice<wbr>Random</a></dt><dd>Extension trait on slices, providing shuffling methods.</dd></dl></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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
<!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="Randomly sample exactly `amount` distinct indices from `0..length`, and return them in random order (fully shuffled)."><title>sample in rand::seq::index - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">sample</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>seq::<wbr>index</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">seq</a>::<wbr><a href="index.html">index</a></div><h1>Function <span class="fn">sample</span>&nbsp;<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/seq/index.rs.html#240-283">Source</a> </span></div><pre class="rust item-decl"><code>pub fn sample&lt;R&gt;(rng: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut R</a>, length: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, amount: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="enum.IndexVec.html" title="enum rand::seq::index::IndexVec">IndexVec</a><div class="where">where
R: <a class="trait" href="../../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Randomly sample exactly <code>amount</code> distinct indices from <code>0..length</code>, and
return them in random order (fully shuffled).</p>
<p>This method is used internally by the slice sampling methods, but it can
sometimes be useful to have the indices themselves so this is provided as
an alternative.</p>
<p>The implementation used is not specified; we automatically select the
fastest available algorithm for the <code>length</code> and <code>amount</code> parameters
(based on detailed profiling on an Intel Haswell CPU). Roughly speaking,
complexity is <code>O(amount)</code>, except that when <code>amount</code> is small, performance
is closer to <code>O(amount^2)</code>, and when <code>length</code> is close to <code>amount</code> then
<code>O(length)</code>.</p>
<p>Note that performance is significantly better over <code>u32</code> indices than over
<code>u64</code> indices. Because of this we hide the underlying type behind an
abstraction, <code>IndexVec</code>.</p>
<p>If an allocation-free <code>no_std</code> function is required, it is suggested
to adapt the internal <code>sample_floyd</code> implementation.</p>
<p>Panics if <code>amount &gt; length</code>.</p>
</div></details></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="Randomly sample exactly `N` distinct indices from `0..len`, and return them in random order (fully shuffled)."><title>sample_array in rand::seq::index - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">sample_array</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>seq::<wbr>index</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">seq</a>::<wbr><a href="index.html">index</a></div><h1>Function <span class="fn">sample_<wbr>array</span>&nbsp;<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/seq/mod.rs.html#61-79">Source</a> </span></div><pre class="rust item-decl"><code>pub fn sample_array&lt;R, const N: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;(
rng: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut R</a>,
len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.array.html">N</a>]&gt;<div class="where">where
R: <a class="trait" href="../../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Randomly sample exactly <code>N</code> distinct indices from <code>0..len</code>, and
return them in random order (fully shuffled).</p>
<p>This is implemented via Floyds algorithm. Time complexity is <code>O(N^2)</code>
and memory complexity is <code>O(N)</code>.</p>
<p>Returns <code>None</code> if (and only if) <code>N &gt; len</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,22 @@
<!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="Randomly sample `amount` distinct indices from `0..length`"><title>sample_weighted in rand::seq::index - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">sample_weighted</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In rand::<wbr>seq::<wbr>index</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">seq</a>::<wbr><a href="index.html">index</a></div><h1>Function <span class="fn">sample_<wbr>weighted</span>&nbsp;<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/seq/index.rs.html#302-329">Source</a> </span></div><pre class="rust item-decl"><code>pub fn sample_weighted&lt;R, F, X&gt;(
rng: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut R</a>,
length: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>,
weight: F,
amount: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="enum.IndexVec.html" title="enum rand::seq::index::IndexVec">IndexVec</a>, <a class="enum" href="../../distr/weighted/enum.Error.html" title="enum rand::distr::weighted::Error">WeightError</a>&gt;<div class="where">where
R: <a class="trait" href="../../trait.Rng.html" title="trait rand::Rng">Rng</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; X,
X: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Randomly sample <code>amount</code> distinct indices from <code>0..length</code></p>
<p>The result may contain less than <code>amount</code> indices if insufficient non-zero
weights are available. Results are returned in an arbitrary order (there is
no guarantee of shuffling or ordering).</p>
<p>Function <code>weight</code> is called once for each index to provide weights.</p>
<p>This method is used internally by the slice sampling methods, but it can
sometimes be useful to have the indices themselves so this is provided as
an alternative.</p>
<p>Error cases:</p>
<ul>
<li><a href="../../distr/weighted/enum.Error.html#variant.InvalidWeight" title="variant rand::distr::weighted::Error::InvalidWeight"><code>WeightError::InvalidWeight</code></a> when a weight is not-a-number or negative.</li>
</ul>
<p>This implementation uses <code>O(length + amount)</code> space and <code>O(length)</code> time.</p>
</div></details></section></div></main></body></html>

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="Low-level API for sampling indices"><title>rand::seq::index - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.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.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.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]--><rustdoc-topbar><h2><a href="#">Module index</a></h2></rustdoc-topbar><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.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module index</a></h2><h3><a href="#enums">Module Items</a></h3><ul class="block"><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rand::<wbr>seq</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rand</a>::<wbr><a href="../index.html">seq</a></div><h1>Module <span>index</span>&nbsp;<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/seq/mod.rs.html#47">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Low-level API for sampling indices</p>
</div></details><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.IndexVec.html" title="enum rand::seq::index::IndexVec">Index<wbr>Vec</a></dt><dd>A vector of indices.</dd><dt><a class="enum" href="enum.IndexVecIntoIter.html" title="enum rand::seq::index::IndexVecIntoIter">Index<wbr>VecInto<wbr>Iter</a></dt><dd>Return type of <code>IndexVec::into_iter</code>.</dd><dt><a class="enum" href="enum.IndexVecIter.html" title="enum rand::seq::index::IndexVecIter">Index<wbr>VecIter</a></dt><dd>Return type of <code>IndexVec::iter</code>.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.sample.html" title="fn rand::seq::index::sample">sample</a></dt><dd>Randomly sample exactly <code>amount</code> distinct indices from <code>0..length</code>, and
return them in random order (fully shuffled).</dd><dt><a class="fn" href="fn.sample_array.html" title="fn rand::seq::index::sample_array">sample_<wbr>array</a></dt><dd>Randomly sample exactly <code>N</code> distinct indices from <code>0..len</code>, and
return them in random order (fully shuffled).</dd><dt><a class="fn" href="fn.sample_weighted.html" title="fn rand::seq::index::sample_weighted">sample_<wbr>weighted</a></dt><dd>Randomly sample <code>amount</code> distinct indices from <code>0..length</code></dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["IndexVec","IndexVecIntoIter","IndexVecIter"],"fn":["sample","sample_array","sample_weighted"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/seq/index/enum.IndexVec.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/index/enum.IndexVec.html">../../../rand/seq/index/enum.IndexVec.html</a>...</p>
<script>location.replace("../../../rand/seq/index/enum.IndexVec.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/seq/index/enum.IndexVecIntoIter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/index/enum.IndexVecIntoIter.html">../../../rand/seq/index/enum.IndexVecIntoIter.html</a>...</p>
<script>location.replace("../../../rand/seq/index/enum.IndexVecIntoIter.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/seq/index/enum.IndexVecIter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/index/enum.IndexVecIter.html">../../../rand/seq/index/enum.IndexVecIter.html</a>...</p>
<script>location.replace("../../../rand/seq/index/enum.IndexVecIter.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/seq/index/fn.sample.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/index/fn.sample.html">../../../rand/seq/index/fn.sample.html</a>...</p>
<script>location.replace("../../../rand/seq/index/fn.sample.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/seq/index/fn.sample_weighted.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/index/fn.sample_weighted.html">../../../rand/seq/index/fn.sample_weighted.html</a>...</p>
<script>location.replace("../../../rand/seq/index/fn.sample_weighted.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/seq/trait.IteratorRandom.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/trait.IteratorRandom.html">../../../rand/seq/trait.IteratorRandom.html</a>...</p>
<script>location.replace("../../../rand/seq/trait.IteratorRandom.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["index"],"struct":["SliceChooseIter"],"trait":["IndexedMutRandom","IndexedRandom","IteratorRandom","SliceRandom"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../rand/seq/struct.SliceChooseIter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/struct.SliceChooseIter.html">../../../rand/seq/struct.SliceChooseIter.html</a>...</p>
<script>location.replace("../../../rand/seq/struct.SliceChooseIter.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/seq/trait.IndexedMutRandom.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/trait.IndexedMutRandom.html">../../../rand/seq/trait.IndexedMutRandom.html</a>...</p>
<script>location.replace("../../../rand/seq/trait.IndexedMutRandom.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/seq/trait.IndexedRandom.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rand/seq/trait.IndexedRandom.html">../../../rand/seq/trait.IndexedRandom.html</a>...</p>
<script>location.replace("../../../rand/seq/trait.IndexedRandom.html" + location.search + location.hash);</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More