mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-17 08:19:51 +00:00
235 lines
No EOL
48 KiB
HTML
235 lines
No EOL
48 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 builder for creating a UUID."><title>Builder in uuid - 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="uuid" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="icon" href="https://www.rust-lang.org/favicon.ico"></head><body class="rustdoc 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="../uuid/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../uuid/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../uuid/index.html">uuid</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Builder</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.as_uuid" title="as_uuid">as_uuid</a></li><li><a href="#method.from_bytes" title="from_bytes">from_bytes</a></li><li><a href="#method.from_bytes_le" title="from_bytes_le">from_bytes_le</a></li><li><a href="#method.from_custom_bytes" title="from_custom_bytes">from_custom_bytes</a></li><li><a href="#method.from_fields" title="from_fields">from_fields</a></li><li><a href="#method.from_fields_le" title="from_fields_le">from_fields_le</a></li><li><a href="#method.from_gregorian_timestamp" title="from_gregorian_timestamp">from_gregorian_timestamp</a></li><li><a href="#method.from_md5_bytes" title="from_md5_bytes">from_md5_bytes</a></li><li><a href="#method.from_random_bytes" title="from_random_bytes">from_random_bytes</a></li><li><a href="#method.from_sha1_bytes" title="from_sha1_bytes">from_sha1_bytes</a></li><li><a href="#method.from_slice" title="from_slice">from_slice</a></li><li><a href="#method.from_slice_le" title="from_slice_le">from_slice_le</a></li><li><a href="#method.from_sorted_gregorian_timestamp" title="from_sorted_gregorian_timestamp">from_sorted_gregorian_timestamp</a></li><li><a href="#method.from_u128" title="from_u128">from_u128</a></li><li><a href="#method.from_u128_le" title="from_u128_le">from_u128_le</a></li><li><a href="#method.from_unix_timestamp_millis" title="from_unix_timestamp_millis">from_unix_timestamp_millis</a></li><li><a href="#method.into_uuid" title="into_uuid">into_uuid</a></li><li><a href="#method.nil" title="nil">nil</a></li><li><a href="#method.set_variant" title="set_variant">set_variant</a></li><li><a href="#method.set_version" title="set_version">set_version</a></li><li><a href="#method.with_variant" title="with_variant">with_variant</a></li><li><a href="#method.with_version" title="with_version">with_version</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Builder" title="Debug">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Builder" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Builder" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Builder" title="Send">Send</a></li><li><a href="#impl-Sync-for-Builder" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Builder" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Builder" 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-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-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 uuid</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">uuid</a></span><h1>Struct <span class="struct">Builder</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/uuid/builder.rs.html#47">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Builder(<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 builder for creating a UUID.</p>
|
||
<p>This type is useful if you need to mutate individual fields of a <a href="struct.Uuid.html" title="struct uuid::Uuid"><code>Uuid</code></a>
|
||
while constructing it. Since the <a href="struct.Uuid.html" title="struct uuid::Uuid"><code>Uuid</code></a> type is <code>Copy</code>, it doesn’t offer
|
||
any methods to mutate in place. They live on the <code>Builder</code> instead.</p>
|
||
<p>The <code>Builder</code> type also always exposes APIs to construct <a href="struct.Uuid.html" title="struct uuid::Uuid"><code>Uuid</code></a>s for any
|
||
version without needing crate features or additional dependencies. It’s a
|
||
lower-level API than the methods on <a href="struct.Uuid.html" title="struct uuid::Uuid"><code>Uuid</code></a>.</p>
|
||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||
<p>Creating a version 4 UUID from externally generated random bytes:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>random_bytes = rng();
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_random_bytes(random_bytes).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(Version::Random), uuid.get_version());
|
||
<span class="macro">assert_eq!</span>(Variant::RFC4122, uuid.get_variant());</code></pre></div>
|
||
</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-Builder" class="impl"><a class="src rightside" href="../src/uuid/builder.rs.html#494-907">Source</a><a href="#impl-Builder" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Builder.html" title="struct uuid::Builder">Builder</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_bytes" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#517-519">Source</a><h4 class="code-header">pub const fn <a href="#method.from_bytes" class="fn">from_bytes</a>(b: <a class="type" href="type.Bytes.html" title="type uuid::Bytes">Bytes</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> using the supplied bytes.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bytes = [
|
||
<span class="number">0xa1</span>, <span class="number">0xa2</span>, <span class="number">0xa3</span>, <span class="number">0xa4</span>,
|
||
<span class="number">0xb1</span>, <span class="number">0xb2</span>,
|
||
<span class="number">0xc1</span>, <span class="number">0xc2</span>,
|
||
<span class="number">0xd1</span>, <span class="number">0xd2</span>, <span class="number">0xd3</span>, <span class="number">0xd4</span>, <span class="number">0xd5</span>, <span class="number">0xd6</span>, <span class="number">0xd7</span>, <span class="number">0xd8</span>,
|
||
];
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_bytes(bytes).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_bytes_le" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#548-550">Source</a><h4 class="code-header">pub const fn <a href="#method.from_bytes_le" class="fn">from_bytes_le</a>(b: <a class="type" href="type.Bytes.html" title="type uuid::Bytes">Bytes</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> using the supplied bytes in little endian order.</p>
|
||
<p>The individual fields encoded in the buffer will be flipped.</p>
|
||
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bytes = [
|
||
<span class="number">0xa1</span>, <span class="number">0xa2</span>, <span class="number">0xa3</span>, <span class="number">0xa4</span>,
|
||
<span class="number">0xb1</span>, <span class="number">0xb2</span>,
|
||
<span class="number">0xc1</span>, <span class="number">0xc2</span>,
|
||
<span class="number">0xd1</span>, <span class="number">0xd2</span>, <span class="number">0xd3</span>, <span class="number">0xd4</span>, <span class="number">0xd5</span>, <span class="number">0xd6</span>, <span class="number">0xd7</span>, <span class="number">0xd8</span>,
|
||
];
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_bytes_le(bytes).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_gregorian_timestamp" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#553-557">Source</a><h4 class="code-header">pub const fn <a href="#method.from_gregorian_timestamp" class="fn">from_gregorian_timestamp</a>(
|
||
ticks: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>,
|
||
counter: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>,
|
||
node_id: &[<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.array.html">6</a>],
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 1 UUID using the supplied timestamp, counter, and node ID.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_md5_bytes" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#560-564">Source</a><h4 class="code-header">pub const fn <a href="#method.from_md5_bytes" class="fn">from_md5_bytes</a>(md5_bytes: <a class="type" href="type.Bytes.html" title="type uuid::Bytes">Bytes</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 3 UUID using the supplied MD5 hashed bytes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_random_bytes" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#585-589">Source</a><h4 class="code-header">pub const fn <a href="#method.from_random_bytes" class="fn">from_random_bytes</a>(random_bytes: <a class="type" href="type.Bytes.html" title="type uuid::Bytes">Bytes</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 4 UUID using the supplied random bytes.</p>
|
||
<p>This method assumes the bytes are already sufficiently random, it will only
|
||
set the appropriate bits for the UUID version and variant.</p>
|
||
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>random_bytes = rng();
|
||
<span class="kw">let </span>uuid = Builder::from_random_bytes(random_bytes).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(Version::Random), uuid.get_version());
|
||
<span class="macro">assert_eq!</span>(Variant::RFC4122, uuid.get_variant());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_sha1_bytes" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#595-599">Source</a><h4 class="code-header">pub const fn <a href="#method.from_sha1_bytes" class="fn">from_sha1_bytes</a>(sha1_bytes: <a class="type" href="type.Bytes.html" title="type uuid::Bytes">Bytes</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 5 UUID using the supplied SHA-1 hashed bytes.</p>
|
||
<p>This method assumes the bytes are already a SHA-1 hash, it will only set the appropriate
|
||
bits for the UUID version and variant.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_sorted_gregorian_timestamp" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#604-612">Source</a><h4 class="code-header">pub const fn <a href="#method.from_sorted_gregorian_timestamp" class="fn">from_sorted_gregorian_timestamp</a>(
|
||
ticks: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>,
|
||
counter: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>,
|
||
node_id: &[<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.array.html">6</a>],
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 6 UUID using the supplied timestamp, counter, and node ID.</p>
|
||
<p>This method will encode the ticks, counter, and node ID in a sortable UUID.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_unix_timestamp_millis" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#643-648">Source</a><h4 class="code-header">pub const fn <a href="#method.from_unix_timestamp_millis" class="fn">from_unix_timestamp_millis</a>(
|
||
millis: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>,
|
||
counter_random_bytes: &[<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.array.html">10</a>],
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 7 UUID using the supplied Unix timestamp and counter bytes.</p>
|
||
<p>This method will set the variant field within the counter bytes without attempting to shift
|
||
the data around it. Callers using the counter as a monotonic value should be careful not to
|
||
store significant data in the 2 least significant bits of the 3rd byte.</p>
|
||
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
|
||
<p>Creating a UUID using the current system timestamp:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::time::{Duration, SystemTime};
|
||
<span class="kw">let </span>ts = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span>random_bytes = rng();
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_unix_timestamp_millis(ts.as_millis().try_into()<span class="question-mark">?</span>, <span class="kw-2">&</span>random_bytes).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(Version::SortRand), uuid.get_version());
|
||
<span class="macro">assert_eq!</span>(Variant::RFC4122, uuid.get_variant());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_custom_bytes" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#654-658">Source</a><h4 class="code-header">pub const fn <a href="#method.from_custom_bytes" class="fn">from_custom_bytes</a>(custom_bytes: <a class="type" href="type.Bytes.html" title="type uuid::Bytes">Bytes</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> for a version 8 UUID using the supplied user-defined bytes.</p>
|
||
<p>This method won’t interpret the given bytes in any way, except to set the appropriate
|
||
bits for the UUID version and variant.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_slice" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#689-691">Source</a><h4 class="code-header">pub fn <a href="#method.from_slice" class="fn">from_slice</a>(b: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="struct.Error.html" title="struct uuid::Error">Error</a>></h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> using the supplied bytes.</p>
|
||
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
|
||
<p>This function will return an error if <code>b</code> has any length other than 16.</p>
|
||
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bytes = [
|
||
<span class="number">0xa1</span>, <span class="number">0xa2</span>, <span class="number">0xa3</span>, <span class="number">0xa4</span>,
|
||
<span class="number">0xb1</span>, <span class="number">0xb2</span>,
|
||
<span class="number">0xc1</span>, <span class="number">0xc2</span>,
|
||
<span class="number">0xd1</span>, <span class="number">0xd2</span>, <span class="number">0xd3</span>, <span class="number">0xd4</span>, <span class="number">0xd5</span>, <span class="number">0xd6</span>, <span class="number">0xd7</span>, <span class="number">0xd8</span>,
|
||
];
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_slice(<span class="kw-2">&</span>bytes)<span class="question-mark">?</span>.into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_slice_le" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#724-726">Source</a><h4 class="code-header">pub fn <a href="#method.from_slice_le" class="fn">from_slice_le</a>(b: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="struct.Error.html" title="struct uuid::Error">Error</a>></h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> using the supplied bytes in little endian order.</p>
|
||
<p>The individual fields encoded in the buffer will be flipped.</p>
|
||
<h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
|
||
<p>This function will return an error if <code>b</code> has any length other than 16.</p>
|
||
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bytes = [
|
||
<span class="number">0xa1</span>, <span class="number">0xa2</span>, <span class="number">0xa3</span>, <span class="number">0xa4</span>,
|
||
<span class="number">0xb1</span>, <span class="number">0xb2</span>,
|
||
<span class="number">0xc1</span>, <span class="number">0xc2</span>,
|
||
<span class="number">0xd1</span>, <span class="number">0xd2</span>, <span class="number">0xd3</span>, <span class="number">0xd4</span>, <span class="number">0xd5</span>, <span class="number">0xd6</span>, <span class="number">0xd7</span>, <span class="number">0xd8</span>,
|
||
];
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_slice_le(<span class="kw-2">&</span>bytes)<span class="question-mark">?</span>.into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_fields" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#748-750">Source</a><h4 class="code-header">pub const fn <a href="#method.from_fields" class="fn">from_fields</a>(d1: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u32.html">u32</a>, d2: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>, d3: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>, d4: &[<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.array.html">8</a>]) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> from four field values.</p>
|
||
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>d1 = <span class="number">0xa1a2a3a4</span>;
|
||
<span class="kw">let </span>d2 = <span class="number">0xb1b2</span>;
|
||
<span class="kw">let </span>d3 = <span class="number">0xc1c2</span>;
|
||
<span class="kw">let </span>d4 = [<span class="number">0xd1</span>, <span class="number">0xd2</span>, <span class="number">0xd3</span>, <span class="number">0xd4</span>, <span class="number">0xd5</span>, <span class="number">0xd6</span>, <span class="number">0xd7</span>, <span class="number">0xd8</span>];
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_fields(d1, d2, d3, <span class="kw-2">&</span>d4).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
uuid.hyphenated().to_string(),
|
||
<span class="string">"a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
|
||
</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_fields_le" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#772-774">Source</a><h4 class="code-header">pub const fn <a href="#method.from_fields_le" class="fn">from_fields_le</a>(d1: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u32.html">u32</a>, d2: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>, d3: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u16.html">u16</a>, d4: &[<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.array.html">8</a>]) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> from four field values.</p>
|
||
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>d1 = <span class="number">0xa1a2a3a4</span>;
|
||
<span class="kw">let </span>d2 = <span class="number">0xb1b2</span>;
|
||
<span class="kw">let </span>d3 = <span class="number">0xc1c2</span>;
|
||
<span class="kw">let </span>d4 = [<span class="number">0xd1</span>, <span class="number">0xd2</span>, <span class="number">0xd3</span>, <span class="number">0xd4</span>, <span class="number">0xd5</span>, <span class="number">0xd6</span>, <span class="number">0xd7</span>, <span class="number">0xd8</span>];
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_fields_le(d1, d2, d3, <span class="kw-2">&</span>d4).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
uuid.hyphenated().to_string(),
|
||
<span class="string">"a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8"
|
||
</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_u128" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#793-795">Source</a><h4 class="code-header">pub const fn <a href="#method.from_u128" class="fn">from_u128</a>(v: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u128.html">u128</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> from a 128bit value.</p>
|
||
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="number">0xa1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8u128</span>;
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_u128(v).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_u128_le" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#814-816">Source</a><h4 class="code-header">pub const fn <a href="#method.from_u128_le" class="fn">from_u128_le</a>(v: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u128.html">u128</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a UUID from a 128bit value in little-endian order.</p>
|
||
<h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="number">0xa1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8u128</span>;
|
||
|
||
<span class="kw">let </span>uuid = Builder::from_u128_le(v).into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"d8d7d6d5-d4d3-d2d1-c2c1-b2b1a4a3a2a1"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.nil" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#833-835">Source</a><h4 class="code-header">pub const fn <a href="#method.nil" class="fn">nil</a>() -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>Builder</code> with an initial <a href="struct.Uuid.html#method.nil" title="associated function uuid::Uuid::nil"><code>Uuid::nil</code></a>.</p>
|
||
<h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uuid = Builder::nil().into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
<span class="string">"00000000-0000-0000-0000-000000000000"</span>,
|
||
uuid.hyphenated().to_string(),
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_variant" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#838-841">Source</a><h4 class="code-header">pub fn <a href="#method.set_variant" class="fn">set_variant</a>(&mut self, v: <a class="enum" href="enum.Variant.html" title="enum uuid::Variant">Variant</a>) -> &mut Self</h4></section></summary><div class="docblock"><p>Specifies the variant of the UUID.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_variant" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#844-855">Source</a><h4 class="code-header">pub const fn <a href="#method.with_variant" class="fn">with_variant</a>(self, v: <a class="enum" href="enum.Variant.html" title="enum uuid::Variant">Variant</a>) -> Self</h4></section></summary><div class="docblock"><p>Specifies the variant of the UUID.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_version" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#858-861">Source</a><h4 class="code-header">pub fn <a href="#method.set_version" class="fn">set_version</a>(&mut self, v: <a class="enum" href="enum.Version.html" title="enum uuid::Version">Version</a>) -> &mut Self</h4></section></summary><div class="docblock"><p>Specifies the version number of the UUID.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_version" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#864-868">Source</a><h4 class="code-header">pub const fn <a href="#method.with_version" class="fn">with_version</a>(self, v: <a class="enum" href="enum.Version.html" title="enum uuid::Version">Version</a>) -> Self</h4></section></summary><div class="docblock"><p>Specifies the version number of the UUID.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_uuid" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#885-887">Source</a><h4 class="code-header">pub const fn <a href="#method.as_uuid" class="fn">as_uuid</a>(&self) -> &<a class="struct" href="struct.Uuid.html" title="struct uuid::Uuid">Uuid</a></h4></section></summary><div class="docblock"><p>Get a reference to the underlying <a href="struct.Uuid.html" title="struct uuid::Uuid"><code>Uuid</code></a>.</p>
|
||
<h5 id="examples-12"><a class="doc-anchor" href="#examples-12">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>builder = Builder::nil();
|
||
|
||
<span class="kw">let </span>uuid1 = builder.as_uuid();
|
||
<span class="kw">let </span>uuid2 = builder.as_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(uuid1, uuid2);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_uuid" class="method"><a class="src rightside" href="../src/uuid/builder.rs.html#904-906">Source</a><h4 class="code-header">pub const fn <a href="#method.into_uuid" class="fn">into_uuid</a>(self) -> <a class="struct" href="struct.Uuid.html" title="struct uuid::Uuid">Uuid</a></h4></section></summary><div class="docblock"><p>Convert the builder into a <a href="struct.Uuid.html" title="struct uuid::Uuid"><code>Uuid</code></a>.</p>
|
||
<h5 id="examples-13"><a class="doc-anchor" href="#examples-13">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uuid = Builder::nil().into_uuid();
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
uuid.hyphenated().to_string(),
|
||
<span class="string">"00000000-0000-0000-0000-000000000000"
|
||
</span>);</code></pre></div>
|
||
</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-Debug-for-Builder" class="impl"><a class="src rightside" href="../src/uuid/builder.rs.html#46">Source</a><a href="#impl-Debug-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</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/uuid/builder.rs.html#46">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></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-Builder" class="impl"><a href="#impl-Freeze-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</a></h3></section><section id="impl-RefUnwindSafe-for-Builder" class="impl"><a href="#impl-RefUnwindSafe-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</a></h3></section><section id="impl-Send-for-Builder" class="impl"><a href="#impl-Send-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</a></h3></section><section id="impl-Sync-for-Builder" class="impl"><a href="#impl-Sync-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</a></h3></section><section id="impl-Unpin-for-Builder" class="impl"><a href="#impl-Unpin-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</a></h3></section><section id="impl-UnwindSafe-for-Builder" class="impl"><a href="#impl-UnwindSafe-for-Builder" 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.Builder.html" title="struct uuid::Builder">Builder</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-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-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> |