You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
102 KiB
44 lines
102 KiB
5 years ago
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Rand` trait in crate `rand`."><meta name="keywords" content="rust, rustlang, rust-lang, Rand"><title>rand::Rand - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../rand/index.html'><div class='logo-container'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk.png' alt='logo'></div></a><p class='location'>Trait Rand</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.rand">rand</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Rand-for-%5BT%3B%200%5D">[T; 0]</a><a href="#impl-Rand-for-%5BT%3B%201%5D">[T; 1]</a><a href="#impl-Rand-for-%5BT%3B%2010%5D">[T; 10]</a><a href="#impl-Rand-for-%5BT%3B%2011%5D">[T; 11]</a><a href="#impl-Rand-for-%5BT%3B%2012%5D">[T; 12]</a><a href="#impl-Rand-for-%5BT%3B%2013%5D">[T; 13]</a><a href="#impl-Rand-for-%5BT%3B%2014%5D">[T; 14]</a><a href="#impl-Rand-for-%5BT%3B%2015%5D">[T; 15]</a><a href="#impl-Rand-for-%5BT%3B%2016%5D">[T; 16]</a><a href="#impl-Rand-for-%5BT%3B%2017%5D">[T; 17]</a><a href="#impl-Rand-for-%5BT%3B%2018%5D">[T; 18]</a><a href="#impl-Rand-for-%5BT%3B%2019%5D">[T; 19]</a><a href="#impl-Rand-for-%5BT%3B%202%5D">[T; 2]</a><a href="#impl-Rand-for-%5BT%3B%2020%5D">[T; 20]</a><a href="#impl-Rand-for-%5BT%3B%2021%5D">[T; 21]</a><a href="#impl-Rand-for-%5BT%3B%2022%5D">[T; 22]</a><a href="#impl-Rand-for-%5BT%3B%2023%5D">[T; 23]</a><a href="#impl-Rand-for-%5BT%3B%2024%5D">[T; 24]</a><a href="#impl-Rand-for-%5BT%3B%2025%5D">[T; 25]</a><a href="#impl-Rand-for-%5BT%3B%2026%5D">[T; 26]</a><a href="#impl-Rand-for-%5BT%3B%2027%5D">[T; 27]</a><a href="#impl-Rand-for-%5BT%3B%2028%5D">[T; 28]</a><a href="#impl-Rand-for-%5BT%3B%2029%5D">[T; 29]</a><a href="#impl-Rand-for-%5BT%3B%203%5D">[T; 3]</a><a href="#impl-Rand-for-%5BT%3B%2030%5D">[T; 30]</a><a href="#impl-Rand-for-%5BT%3B%2031%5D">[T; 31]</a><a href="#impl-Rand-for-%5BT%3B%2032%5D">[T; 32]</a><a href="#impl-Rand-for-%5BT%3B%204%5D">[T; 4]</a><a href="#impl-Rand-for-%5BT%3B%205%5D">[T; 5]</a><a href="#impl-Rand-for-%5BT%3B%206%5D">[T; 6]</a><a href="#impl-Rand-for-%5BT%3B%207%5D">[T; 7]</a><a href="#impl-Rand-for-%5BT%3B%208%5D">[T; 8]</a><a href="#impl-Rand-for-%5BT%3B%209%5D">[T; 9]</a><a href="#impl-Rand-for-()">()</a><a href="#impl-Rand-for-(A%2C%20B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G%2C%20H%2C%20I%2C%20J%2C%20K%2C%20L)">(A, B, C, D, E, F, G, H, I, J, K, L)</a><a href="#impl-Rand-for-(A%2C%20B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G%2C%20H%2C%20I%2C%20J%2C%20K)">(A, B, C, D, E, F, G, H, I, J, K)</a><a href="#impl-Rand-for-(A%2C%20B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G%2C%20H%2C%20I%2C%20J)">(A, B, C, D, E, F, G, H, I, J)</a><a href="#impl-Rand-for-(A%2C%20B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G%2C%20H%2C%20I)">(A, B, C, D, E, F, G, H, I)</a><a href="#impl-Rand-for-(A%2C%20B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G%2C%20H)">(A, B, C, D, E, F, G, H)</a><a href="#impl-Rand-for-(A%2C%20B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G)">(A, B, C, D, E, F, G)</a><a href="#impl-Rand-for-(A%2C%20
|
||
|
fn <a href='#tymethod.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> Self;
|
||
|
}</pre></div><div class='docblock'><p>A type that can be randomly generated using an <code>Rng</code>.</p>
|
||
|
<h2 id="built-in-implementations" class="section-header"><a href="#built-in-implementations">Built-in Implementations</a></h2>
|
||
|
<p>This crate implements <code>Rand</code> for various primitive types. Assuming the
|
||
|
provided <code>Rng</code> is well-behaved, these implementations generate values with
|
||
|
the following ranges and distributions:</p>
|
||
|
<ul>
|
||
|
<li>Integers (<code>i32</code>, <code>u32</code>, <code>isize</code>, <code>usize</code>, etc.): Uniformly distributed
|
||
|
over all values of the type.</li>
|
||
|
<li><code>char</code>: Uniformly distributed over all Unicode scalar values, i.e. all
|
||
|
code points in the range <code>0...0x10_FFFF</code>, except for the range
|
||
|
<code>0xD800...0xDFFF</code> (the surrogate code points). This includes
|
||
|
unassigned/reserved code points.</li>
|
||
|
<li><code>bool</code>: Generates <code>false</code> or <code>true</code>, each with probability 0.5.</li>
|
||
|
<li>Floating point types (<code>f32</code> and <code>f64</code>): Uniformly distributed in the
|
||
|
half-open range <code>[0, 1)</code>. (The <a href="struct.Open01.html"><code>Open01</code></a>, <a href="struct.Closed01.html"><code>Closed01</code></a>, <a href="distributions/exponential/struct.Exp1.html"><code>Exp1</code></a>, and
|
||
|
<a href="distributions/normal/struct.StandardNormal.html"><code>StandardNormal</code></a> wrapper types produce floating point numbers with
|
||
|
alternative ranges or distributions.)</li>
|
||
|
</ul>
|
||
|
<p>The following aggregate types also implement <code>Rand</code> as long as their
|
||
|
component types implement it:</p>
|
||
|
<ul>
|
||
|
<li>Tuples and arrays: Each element of the tuple or array is generated
|
||
|
independently, using its own <code>Rand</code> implementation.</li>
|
||
|
<li><code>Option<T></code>: Returns <code>None</code> with probability 0.5; otherwise generates a
|
||
|
random <code>T</code> and returns <code>Some(T)</code>.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.rand' class='method'><code id='rand.v'>fn <a href='#tymethod.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> Self</code></h3><div class='docblock'><p>Generates a random instance of this type using the specified source of
|
||
|
randomness.</p>
|
||
|
</div></div><span class='loading-content'>Loading content...</span>
|
||
|
<h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Rand-for-isize' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a></code><a href='#impl-Rand-for-isize' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#17-26' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand' class="method hidden"><code id='rand.v-1'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#19-25' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-i8' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a></code><a href='#impl-Rand-for-i8' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#28-33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-1' class="method hidden"><code id='rand.v-2'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#30-32' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-i16' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a></code><a href='#impl-Rand-for-i16' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#35-40' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-2' class="method hidden"><code id='rand.v-3'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#37-39' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-i32' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a href='#impl-Rand-for-i32' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#42-47' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-3' class="method hidden"><code id='rand.v-4'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#44-46' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-i64' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Ra
|
||
|
interval <code>[0,1)</code>.</p>
|
||
|
<p>See <code>Closed01</code> for the closed interval <code>[0,1]</code>,
|
||
|
and <code>Open01</code> for the open interval <code>(0,1)</code>.</p>
|
||
|
</div></div><h3 id='impl-Rand-for-f32' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></code><a href='#impl-Rand-for-f32' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#119-129' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-11' class="method"><code id='rand.v-12'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#126-128' title='goto source code'>[src]</a></h4><div class='docblock'><p>Generate a floating point number in the half-open
|
||
|
interval <code>[0,1)</code>.</p>
|
||
|
<p>See <code>Closed01</code> for the closed interval <code>[0,1]</code>,
|
||
|
and <code>Open01</code> for the open interval <code>(0,1)</code>.</p>
|
||
|
</div></div><h3 id='impl-Rand-for-char' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code><a href='#impl-Rand-for-char' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#154-169' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-12' class="method hidden"><code id='rand.v-13'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#156-168' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-bool' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a href='#impl-Rand-for-bool' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#171-176' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-13' class="method hidden"><code id='rand.v-14'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#173-175' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-()' class='impl'><code class='in-band'>impl <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code><a href='#impl-Rand-for-()' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#201-204' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-14' class="method hidden"><code id='rand.v-15'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(_: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R)</code><a class='srclink' href='../src/rand/rand_impls.rs.html#203' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-(A%2C)' class='impl'><code class='in-band'>impl<A: <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a>> <a class="trait" href="../rand/trait.Rand.html" title="trait rand::Rand">Rand</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">,)</a></code><a href='#impl-Rand-for-(A%2C)' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#182-197' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-15' class="method hidden"><code id='rand.v-16'>fn <a href='#method.rand' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(_rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">,)</a></code><a class='srclink' href='../src/rand/rand_impls.rs.html#187-196' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-for-
|
||
|
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Rand' class='impl'><code class='in-band'>impl Rand for <a class="struct" href="../rand/distributions/exponential/struct.Exp1.html" title="struct rand::distributions::exponential::Exp1">Exp1</a></code><a href='#impl-Rand' class='anchor'></a><a class='srclink' href='../src/rand/distributions/exponential.rs.html#41-58' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-61' class="method hidden"><code id='rand.v-62'>fn <a href='#method.rand-61' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="struct" href="../rand/distributions/exponential/struct.Exp1.html" title="struct rand::distributions::exponential::Exp1">Exp1</a></code><a class='srclink' href='../src/rand/distributions/exponential.rs.html#43-57' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-1' class='impl'><code class='in-band'>impl Rand for <a class="struct" href="../rand/distributions/normal/struct.StandardNormal.html" title="struct rand::distributions::normal::StandardNormal">StandardNormal</a></code><a href='#impl-Rand-1' class='anchor'></a><a class='srclink' href='../src/rand/distributions/normal.rs.html#39-74' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-62' class="method hidden"><code id='rand.v-63'>fn <a href='#method.rand-62' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="struct" href="../rand/distributions/normal/struct.StandardNormal.html" title="struct rand::distributions::normal::StandardNormal">StandardNormal</a></code><a class='srclink' href='../src/rand/distributions/normal.rs.html#40-73' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-2' class='impl'><code class='in-band'>impl Rand for <a class="struct" href="../rand/struct.ChaChaRng.html" title="struct rand::ChaChaRng">ChaChaRng</a></code><a href='#impl-Rand-2' class='anchor'></a><a class='srclink' href='../src/rand/prng/chacha.rs.html#224-232' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-63' class="method hidden"><code id='rand.v-64'>fn <a href='#method.rand-63' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="struct" href="../rand/struct.ChaChaRng.html" title="struct rand::ChaChaRng">ChaChaRng</a></code><a class='srclink' href='../src/rand/prng/chacha.rs.html#225-231' title='goto source code'>[src]</a></h4></div><h3 id='impl-Rand-3' class='impl'><code class='in-band'>impl Rand for <a class="struct" href="../rand/struct.Closed01.html" title="struct rand::Closed01">Closed01</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>></code><a href='#impl-Rand-3' class='anchor'></a><a class='srclink' href='../src/rand/rand_impls.rs.html#140-147' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rand-64' class="method hidden"><code id='rand.v-65'>fn <a href='#method.rand-64' class='fnname'>rand</a><R: <a class="trait" href="../rand/trait.Rng.html" title="trait rand::Rng">Rng</a>>(rng: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>R) -> <a class="struct" href="../rand/struct.Closed01.html" title="struct rand::Closed01">Closed01</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>></code><a class='srclink' href='../
|
||
|
src="../implementors/rand/trait.Rand.js">
|
||
|
</script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "rand";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|