mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-16 16:03:48 +00:00
93 lines
No EOL
55 KiB
HTML
93 lines
No EOL
55 KiB
HTML
<!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 random number generator."><title>Rng in fastrand - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="fastrand" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="icon" href="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../fastrand/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../fastrand/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt="logo"></a><h2><a href="../fastrand/index.html">fastrand</a><span class="version">2.3.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Rng</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.alphabetic" title="alphabetic">alphabetic</a></li><li><a href="#method.alphanumeric" title="alphanumeric">alphanumeric</a></li><li><a href="#method.bool" title="bool">bool</a></li><li><a href="#method.char" title="char">char</a></li><li><a href="#method.choice" title="choice">choice</a></li><li><a href="#method.choose_multiple" title="choose_multiple">choose_multiple</a></li><li><a href="#method.digit" title="digit">digit</a></li><li><a href="#method.f32" title="f32">f32</a></li><li><a href="#method.f64" title="f64">f64</a></li><li><a href="#method.fill" title="fill">fill</a></li><li><a href="#method.fork" title="fork">fork</a></li><li><a href="#method.get_seed" title="get_seed">get_seed</a></li><li><a href="#method.i128" title="i128">i128</a></li><li><a href="#method.i16" title="i16">i16</a></li><li><a href="#method.i32" title="i32">i32</a></li><li><a href="#method.i64" title="i64">i64</a></li><li><a href="#method.i8" title="i8">i8</a></li><li><a href="#method.isize" title="isize">isize</a></li><li><a href="#method.lowercase" title="lowercase">lowercase</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.seed" title="seed">seed</a></li><li><a href="#method.shuffle" title="shuffle">shuffle</a></li><li><a href="#method.u128" title="u128">u128</a></li><li><a href="#method.u16" title="u16">u16</a></li><li><a href="#method.u32" title="u32">u32</a></li><li><a href="#method.u64" title="u64">u64</a></li><li><a href="#method.u8" title="u8">u8</a></li><li><a href="#method.uppercase" title="uppercase">uppercase</a></li><li><a href="#method.usize" title="usize">usize</a></li><li><a href="#method.with_seed" title="with_seed">with_seed</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-Rng" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-Rng" title="Debug">Debug</a></li><li><a href="#impl-Default-for-Rng" title="Default">Default</a></li><li><a href="#impl-Eq-for-Rng" title="Eq">Eq</a></li><li><a href="#impl-PartialEq-for-Rng" title="PartialEq">PartialEq</a></li><li><a href="#impl-StructuralPartialEq-for-Rng" title="StructuralPartialEq">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Rng" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Rng" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Rng" title="Send">Send</a></li><li><a href="#impl-Sync-for-Rng" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Rng" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Rng" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate fastrand</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">fastrand</a></span><h1>Struct <span class="struct">Rng</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/fastrand/lib.rs.html#132">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Rng(<span class="comment">/* private fields */</span>);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A random number generator.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Rng" class="impl"><a class="src rightside" href="../src/fastrand/global_rng.rs.html#22-28">Source</a><a href="#impl-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/fastrand/global_rng.rs.html#25-27">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -> <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h4></section></summary><div class="docblock"><p>Creates a new random number generator.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Rng-1" class="impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#289-689">Source</a><a href="#impl-Rng-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_seed" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#293-295">Source</a><h4 class="code-header">pub fn <a href="#method.with_seed" class="fn">with_seed</a>(seed: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a new random number generator with the initial seed.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.fork" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#322-324">Source</a><h4 class="code-header">pub fn <a href="#method.fork" class="fn">fork</a>(&mut self) -> Self</h4></section></summary><div class="docblock"><p>Clones the generator by deterministically deriving a new generator based on the initial
|
||
seed.</p>
|
||
<p>This function can be used to create a new generator that is a “spinoff” of the old
|
||
generator. The new generator will not produce the same sequence of values as the
|
||
old generator.</p>
|
||
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Seed two generators equally, and clone both of them.
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>base1 = fastrand::Rng::with_seed(<span class="number">0x4d595df4d0f33173</span>);
|
||
base1.bool(); <span class="comment">// Use the generator once.
|
||
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>base2 = fastrand::Rng::with_seed(<span class="number">0x4d595df4d0f33173</span>);
|
||
base2.bool(); <span class="comment">// Use the generator once.
|
||
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>rng1 = base1.fork();
|
||
<span class="kw">let </span><span class="kw-2">mut </span>rng2 = base2.fork();
|
||
|
||
<span class="macro">println!</span>(<span class="string">"rng1 returns {}"</span>, rng1.u32(..));
|
||
<span class="macro">println!</span>(<span class="string">"rng2 returns {}"</span>, rng2.u32(..));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.alphabetic" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#328-331">Source</a><h4 class="code-header">pub fn <a href="#method.alphabetic" class="fn">alphabetic</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a></h4></section></summary><div class="docblock"><p>Generates a random <code>char</code> in ranges a-z and A-Z.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.alphanumeric" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#335-338">Source</a><h4 class="code-header">pub fn <a href="#method.alphanumeric" class="fn">alphanumeric</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a></h4></section></summary><div class="docblock"><p>Generates a random <code>char</code> in ranges a-z, A-Z and 0-9.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.bool" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#342-344">Source</a><h4 class="code-header">pub fn <a href="#method.bool" class="fn">bool</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Generates a random <code>bool</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.digit" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#352-365">Source</a><h4 class="code-header">pub fn <a href="#method.digit" class="fn">digit</a>(&mut self, base: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u32.html">u32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a></h4></section></summary><div class="docblock"><p>Generates a random digit in the given <code>base</code>.</p>
|
||
<p>Digits are represented by <code>char</code>s in ranges 0-9 and a-z.</p>
|
||
<p>Panics if the base is zero or greater than 36.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.f32" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#368-372">Source</a><h4 class="code-header">pub fn <a href="#method.f32" class="fn">f32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Generates a random <code>f32</code> in range <code>0..1</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.f64" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#375-379">Source</a><h4 class="code-header">pub fn <a href="#method.f64" class="fn">f64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.f64.html">f64</a></h4></section></summary><div class="docblock"><p>Generates a random <code>f64</code> in range <code>0..1</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.choose_multiple" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#390-418">Source</a><h4 class="code-header">pub fn <a href="#method.choose_multiple" class="fn">choose_multiple</a><I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>(
|
||
&mut self,
|
||
source: I,
|
||
amount: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
|
||
) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>></h4></section></summary><div class="docblock"><p>Collects <code>amount</code> values at random from the iterable into a vector.</p>
|
||
<p>The length of the returned vector equals <code>amount</code> unless the iterable
|
||
contains insufficient elements, in which case it equals the number of
|
||
elements available.</p>
|
||
<p>Complexity is <code>O(n)</code> where <code>n</code> is the length of the iterable.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.i8" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#420-426">Source</a><h4 class="code-header">pub fn <a href="#method.i8" class="fn">i8</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i8.html">i8</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i8.html">i8</a></h4></section></summary><div class="docblock"><p>Generates a random <code>i8</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.i16" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#428-434">Source</a><h4 class="code-header">pub fn <a href="#method.i16" class="fn">i16</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i16.html">i16</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Generates a random <code>i16</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.i32" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#436-442">Source</a><h4 class="code-header">pub fn <a href="#method.i32" class="fn">i32</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i32.html">i32</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Generates a random <code>i32</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.i64" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#444-450">Source</a><h4 class="code-header">pub fn <a href="#method.i64" class="fn">i64</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i64.html">i64</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Generates a random <code>i64</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.i128" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#452-458">Source</a><h4 class="code-header">pub fn <a href="#method.i128" class="fn">i128</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i128.html">i128</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i128.html">i128</a></h4></section></summary><div class="docblock"><p>Generates a random <code>i128</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.isize" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#477-483">Source</a><h4 class="code-header">pub fn <a href="#method.isize" class="fn">isize</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.isize.html">isize</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.isize.html">isize</a></h4></section></summary><div class="docblock"><p>Generates a random <code>isize</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.lowercase" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#487-490">Source</a><h4 class="code-header">pub fn <a href="#method.lowercase" class="fn">lowercase</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a></h4></section></summary><div class="docblock"><p>Generates a random <code>char</code> in range a-z.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.seed" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#494-496">Source</a><h4 class="code-header">pub fn <a href="#method.seed" class="fn">seed</a>(&mut self, seed: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>)</h4></section></summary><div class="docblock"><p>Initializes this generator with the given seed.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_seed" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#500-502">Source</a><h4 class="code-header">pub fn <a href="#method.get_seed" class="fn">get_seed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gives back <strong>current</strong> seed that is being held by this generator.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.choice" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#510-525">Source</a><h4 class="code-header">pub fn <a href="#method.choice" class="fn">choice</a><I>(&mut self, iter: I) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>><div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,
|
||
I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/iter/traits/exact_size/trait.ExactSizeIterator.html" title="trait core::iter::traits::exact_size::ExactSizeIterator">ExactSizeIterator</a>,</div></h4></section></summary><div class="docblock"><p>Choose an item from an iterator at random.</p>
|
||
<p>This function may have an unexpected result if the <code>len()</code> property of the
|
||
iterator does not match the actual number of items in the iterator. If
|
||
the iterator is empty, this returns <code>None</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.shuffle" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#529-533">Source</a><h4 class="code-header">pub fn <a href="#method.shuffle" class="fn">shuffle</a><T>(&mut self, slice: &mut <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.slice.html">[T]</a>)</h4></section></summary><div class="docblock"><p>Shuffles a slice randomly.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.fill" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#537-557">Source</a><h4 class="code-header">pub fn <a href="#method.fill" class="fn">fill</a>(&mut self, slice: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>])</h4></section></summary><div class="docblock"><p>Fill a byte slice with random data.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.u8" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#559-565">Source</a><h4 class="code-header">pub fn <a href="#method.u8" class="fn">u8</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Generates a random <code>u8</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.u16" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#567-573">Source</a><h4 class="code-header">pub fn <a href="#method.u16" class="fn">u16</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Generates a random <code>u16</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.u32" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#575-581">Source</a><h4 class="code-header">pub fn <a href="#method.u32" class="fn">u32</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u32.html">u32</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Generates a random <code>u32</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.u64" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#583-589">Source</a><h4 class="code-header">pub fn <a href="#method.u64" class="fn">u64</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Generates a random <code>u64</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.u128" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#591-597">Source</a><h4 class="code-header">pub fn <a href="#method.u128" class="fn">u128</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u128.html">u128</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u128.html">u128</a></h4></section></summary><div class="docblock"><p>Generates a random <code>u128</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.usize" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#616-622">Source</a><h4 class="code-header">pub fn <a href="#method.usize" class="fn">usize</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Generates a random <code>usize</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.uppercase" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#626-629">Source</a><h4 class="code-header">pub fn <a href="#method.uppercase" class="fn">uppercase</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a></h4></section></summary><div class="docblock"><p>Generates a random <code>char</code> in range A-Z.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.char" class="method"><a class="src rightside" href="../src/fastrand/lib.rs.html#635-688">Source</a><h4 class="code-header">pub fn <a href="#method.char" class="fn">char</a>(&mut self, range: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.char.html">char</a></h4></section></summary><div class="docblock"><p>Generates a random <code>char</code> in the given range.</p>
|
||
<p>Panics if the range is empty.</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-Rng" class="impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#134-139">Source</a><a href="#impl-Clone-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#136-138">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h4></section></summary><div class="docblock"><p>Clones the generator by creating a new generator with the same seed.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Rng" class="impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#131">Source</a><a href="#impl-Debug-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#131">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-Rng" class="impl"><a class="src rightside" href="../src/fastrand/global_rng.rs.html#12-20">Source</a><a href="#impl-Default-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/fastrand/global_rng.rs.html#17-19">Source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h4></section></summary><div class="docblock"><p>Initialize the <code>Rng</code> from the system’s random number generator.</p>
|
||
<p>This is equivalent to <a href="struct.Rng.html#method.new" title="associated function fastrand::Rng::new"><code>Rng::new()</code></a>.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Rng" class="impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#131">Source</a><a href="#impl-PartialEq-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#131">Source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><section id="impl-Eq-for-Rng" class="impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#131">Source</a><a href="#impl-Eq-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section><section id="impl-StructuralPartialEq-for-Rng" class="impl"><a class="src rightside" href="../src/fastrand/lib.rs.html#131">Source</a><a href="#impl-StructuralPartialEq-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Rng" class="impl"><a href="#impl-Freeze-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section><section id="impl-RefUnwindSafe-for-Rng" class="impl"><a href="#impl-RefUnwindSafe-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section><section id="impl-Send-for-Rng" class="impl"><a href="#impl-Send-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section><section id="impl-Sync-for-Rng" class="impl"><a href="#impl-Sync-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section><section id="impl-Unpin-for-Rng" class="impl"><a href="#impl-Unpin-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section><section id="impl-UnwindSafe-for-Rng" class="impl"><a href="#impl-UnwindSafe-for-Rng" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Rng.html" title="struct fastrand::Rng">Rng</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.84.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.84.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.1/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html> |