mpvrc/zerocopy/struct.Ref.html

368 lines
No EOL
118 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 typed reference derived from a byte slice."><title>Ref in zerocopy - 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="zerocopy" 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="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../zerocopy/index.html">zerocopy</a><span class="version">0.7.35</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Ref</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.bytes" title="bytes">bytes</a></li><li><a href="#method.bytes_mut" title="bytes_mut">bytes_mut</a></li><li><a href="#method.into_mut" title="into_mut">into_mut</a></li><li><a href="#method.into_mut_slice" title="into_mut_slice">into_mut_slice</a></li><li><a href="#method.into_ref" title="into_ref">into_ref</a></li><li><a href="#method.into_slice" title="into_slice">into_slice</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.new_from_prefix" title="new_from_prefix">new_from_prefix</a></li><li><a href="#method.new_from_prefix_zeroed" title="new_from_prefix_zeroed">new_from_prefix_zeroed</a></li><li><a href="#method.new_from_suffix" title="new_from_suffix">new_from_suffix</a></li><li><a href="#method.new_from_suffix_zeroed" title="new_from_suffix_zeroed">new_from_suffix_zeroed</a></li><li><a href="#method.new_slice" title="new_slice">new_slice</a></li><li><a href="#method.new_slice_from_prefix" title="new_slice_from_prefix">new_slice_from_prefix</a></li><li><a href="#method.new_slice_from_prefix_zeroed" title="new_slice_from_prefix_zeroed">new_slice_from_prefix_zeroed</a></li><li><a href="#method.new_slice_from_suffix" title="new_slice_from_suffix">new_slice_from_suffix</a></li><li><a href="#method.new_slice_from_suffix_zeroed" title="new_slice_from_suffix_zeroed">new_slice_from_suffix_zeroed</a></li><li><a href="#method.new_slice_unaligned" title="new_slice_unaligned">new_slice_unaligned</a></li><li><a href="#method.new_slice_unaligned_from_prefix" title="new_slice_unaligned_from_prefix">new_slice_unaligned_from_prefix</a></li><li><a href="#method.new_slice_unaligned_from_prefix_zeroed" title="new_slice_unaligned_from_prefix_zeroed">new_slice_unaligned_from_prefix_zeroed</a></li><li><a href="#method.new_slice_unaligned_from_suffix" title="new_slice_unaligned_from_suffix">new_slice_unaligned_from_suffix</a></li><li><a href="#method.new_slice_unaligned_from_suffix_zeroed" title="new_slice_unaligned_from_suffix_zeroed">new_slice_unaligned_from_suffix_zeroed</a></li><li><a href="#method.new_slice_unaligned_zeroed" title="new_slice_unaligned_zeroed">new_slice_unaligned_zeroed</a></li><li><a href="#method.new_slice_zeroed" title="new_slice_zeroed">new_slice_zeroed</a></li><li><a href="#method.new_unaligned" title="new_unaligned">new_unaligned</a></li><li><a href="#method.new_unaligned_from_prefix" title="new_unaligned_from_prefix">new_unaligned_from_prefix</a></li><li><a href="#method.new_unaligned_from_prefix_zeroed" title="new_unaligned_from_prefix_zeroed">new_unaligned_from_prefix_zeroed</a></li><li><a href="#method.new_unaligned_from_suffix" title="new_unaligned_from_suffix">new_unaligned_from_suffix</a></li><li><a href="#method.new_unaligned_from_suffix_zeroed" title="new_unaligned_from_suffix_zeroed">new_unaligned_from_suffix_zeroed</a></li><li><a href="#method.new_unaligned_zeroed" title="new_unaligned_zeroed">new_unaligned_zeroed</a></li><li><a href="#method.new_zeroed" title="new_zeroed">new_zeroed</a></li><li><a href="#method.read" title="read">read</a></li><li><a href="#method.write" title="write">write</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Ref%3CB,+%5BT%5D%3E" title="Debug">Debug</a></li><li><a href="#impl-Debug-for-Ref%3CB,+T%3E" title="Debug">Debug</a></li><li><a href="#impl-Deref-for-Ref%3CB,+%5BT%5D%3E" title="Deref">Deref</a></li><li><a href="#impl-Deref-for-Ref%3CB,+T%3E" title="Deref">Deref</a></li><li><a href="#impl-DerefMut-for-Ref%3CB,+%5BT%5D%3E" title="DerefMut">DerefMut</a></li><li><a href="#impl-DerefMut-for-Ref%3CB,+T%3E" title="DerefMut">DerefMut</a></li><li><a href="#impl-Display-for-Ref%3CB,+%5BT%5D%3E" title="Display">Display</a></li><li><a href="#impl-Display-for-Ref%3CB,+T%3E" title="Display">Display</a></li><li><a href="#impl-Eq-for-Ref%3CB,+%5BT%5D%3E" title="Eq">Eq</a></li><li><a href="#impl-Eq-for-Ref%3CB,+T%3E" title="Eq">Eq</a></li><li><a href="#impl-Ord-for-Ref%3CB,+%5BT%5D%3E" title="Ord">Ord</a></li><li><a href="#impl-Ord-for-Ref%3CB,+T%3E" title="Ord">Ord</a></li><li><a href="#impl-PartialEq-for-Ref%3CB,+%5BT%5D%3E" title="PartialEq">PartialEq</a></li><li><a href="#impl-PartialEq-for-Ref%3CB,+T%3E" title="PartialEq">PartialEq</a></li><li><a href="#impl-PartialOrd-for-Ref%3CB,+%5BT%5D%3E" title="PartialOrd">PartialOrd</a></li><li><a href="#impl-PartialOrd-for-Ref%3CB,+T%3E" title="PartialOrd">PartialOrd</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Ref%3CB,+T%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Ref%3CB,+T%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Ref%3CB,+T%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-Ref%3CB,+T%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Ref%3CB,+T%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Ref%3CB,+T%3E" 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&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-Receiver-for-P" title="Receiver">Receiver</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate zerocopy</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">zerocopy</a></span><h1>Struct <span class="struct">Ref</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/zerocopy/lib.rs.html#4152">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Ref&lt;B, 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>&gt;(<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 typed reference derived from a byte slice.</p>
<p>A <code>Ref&lt;B, T&gt;</code> is a reference to a <code>T</code> which is stored in a byte slice, <code>B</code>.
Unlike a native reference (<code>&amp;T</code> or <code>&amp;mut T</code>), <code>Ref&lt;B, T&gt;</code> has the same
mutability as the byte slice it was constructed from (<code>B</code>).</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p><code>Ref</code> can be used to treat a sequence of bytes as a structured type, and to
read and write the fields of that type as if the byte slice reference were
simply a reference to that type.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerocopy::{AsBytes, ByteSlice, ByteSliceMut, FromBytes, FromZeroes, Ref, Unaligned};
<span class="attr">#[derive(FromZeroes, FromBytes, AsBytes, Unaligned)]
#[repr(C)]
</span><span class="kw">struct </span>UdpHeader {
src_port: [u8; <span class="number">2</span>],
dst_port: [u8; <span class="number">2</span>],
length: [u8; <span class="number">2</span>],
checksum: [u8; <span class="number">2</span>],
}
<span class="kw">struct </span>UdpPacket&lt;B&gt; {
header: Ref&lt;B, UdpHeader&gt;,
body: B,
}
<span class="kw">impl</span>&lt;B: ByteSlice&gt; UdpPacket&lt;B&gt; {
<span class="kw">pub fn </span>parse(bytes: B) -&gt; <span class="prelude-ty">Option</span>&lt;UdpPacket&lt;B&gt;&gt; {
<span class="kw">let </span>(header, body) = Ref::new_unaligned_from_prefix(bytes)<span class="question-mark">?</span>;
<span class="prelude-val">Some</span>(UdpPacket { header, body })
}
<span class="kw">pub fn </span>get_src_port(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; [u8; <span class="number">2</span>] {
<span class="self">self</span>.header.src_port
}
}
<span class="kw">impl</span>&lt;B: ByteSliceMut&gt; UdpPacket&lt;B&gt; {
<span class="kw">pub fn </span>set_src_port(<span class="kw-2">&amp;mut </span><span class="self">self</span>, src_port: [u8; <span class="number">2</span>]) {
<span class="self">self</span>.header.src_port = src_port;
}
}</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-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4159-4210">Source</a><a href="#impl-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,</div></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/zerocopy/lib.rs.html#4169-4174">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code>.</p>
<p><code>new</code> verifies that <code>bytes.len() == size_of::&lt;T&gt;()</code> and that <code>bytes</code> is
aligned to <code>align_of::&lt;T&gt;()</code>, and constructs a new <code>Ref</code>. If either of
these checks fail, it returns <code>None</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_from_prefix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4184-4190">Source</a><h4 class="code-header">pub fn <a href="#method.new_from_prefix" class="fn">new_from_prefix</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the prefix of a byte slice.</p>
<p><code>new_from_prefix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code> and that
<code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>. It consumes the first
<code>size_of::&lt;T&gt;()</code> bytes from <code>bytes</code> to construct a <code>Ref</code>, and returns
the remaining bytes to the caller. If either the length or alignment
checks fail, it returns <code>None</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_from_suffix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4201-4209">Source</a><h4 class="code-header">pub fn <a href="#method.new_from_suffix" class="fn">new_from_suffix</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the suffix of a byte slice.</p>
<p><code>new_from_suffix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code> and that
the last <code>size_of::&lt;T&gt;()</code> bytes of <code>bytes</code> are aligned to
<code>align_of::&lt;T&gt;()</code>. It consumes the last <code>size_of::&lt;T&gt;()</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the preceding bytes to the
caller. If either the length or alignment checks fail, it returns
<code>None</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4212-4285">Source</a><a href="#impl-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_slice" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4227-4236">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice" class="fn">new_slice</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type.</p>
<p><code>new_slice</code> verifies that <code>bytes.len()</code> is a multiple of
<code>size_of::&lt;T&gt;()</code> and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>, and
constructs a new <code>Ref</code>. If either of these checks fail, it returns
<code>None</code>.</p>
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p><code>new_slice</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_from_prefix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4251-4261">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_from_prefix" class="fn">new_slice_from_prefix</a>(bytes: B, count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type from the prefix of a byte slice.</p>
<p><code>new_slice_from_prefix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code> and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>. It consumes the
first <code>size_of::&lt;T&gt;() * count</code> bytes from <code>bytes</code> to construct a <code>Ref</code>,
and returns the remaining bytes to the caller. It also ensures that
<code>sizeof::&lt;T&gt;() * count</code> does not overflow a <code>usize</code>. If any of the
length, alignment, or overflow checks fail, it returns <code>None</code>.</p>
<h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
<p><code>new_slice_from_prefix</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_from_suffix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4276-4284">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_from_suffix" class="fn">new_slice_from_suffix</a>(bytes: B, count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type from the suffix of a byte slice.</p>
<p><code>new_slice_from_suffix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code> and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>. It consumes the
last <code>size_of::&lt;T&gt;() * count</code> bytes from <code>bytes</code> to construct a <code>Ref</code>,
and returns the preceding bytes to the caller. It also ensures that
<code>sizeof::&lt;T&gt;() * count</code> does not overflow a <code>usize</code>. If any of the
length, alignment, or overflow checks fail, it returns <code>None</code>.</p>
<h5 id="panics-2"><a class="doc-anchor" href="#panics-2">§</a>Panics</h5>
<p><code>new_slice_from_suffix</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-1" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4315-4367">Source</a><a href="#impl-Ref%3CB,+T%3E-1" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4329-4331">Source</a><h4 class="code-header">pub fn <a href="#method.new_zeroed" class="fn">new_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> after zeroing the bytes.</p>
<p><code>new_zeroed</code> verifies that <code>bytes.len() == size_of::&lt;T&gt;()</code> and that
<code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>, and constructs a new <code>Ref</code>. If
either of these checks fail, it returns <code>None</code>.</p>
<p>If the checks succeed, then <code>bytes</code> will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_from_prefix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4346-4348">Source</a><h4 class="code-header">pub fn <a href="#method.new_from_prefix_zeroed" class="fn">new_from_prefix_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the prefix of a byte slice, zeroing the
prefix.</p>
<p><code>new_from_prefix_zeroed</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code>
and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>. It consumes the first
<code>size_of::&lt;T&gt;()</code> bytes from <code>bytes</code> to construct a <code>Ref</code>, and returns
the remaining bytes to the caller. If either the length or alignment
checks fail, it returns <code>None</code>.</p>
<p>If the checks succeed, then the prefix which is consumed will be
initialized to zero. This can be useful when re-using buffers to ensure
that sensitive data previously stored in the buffer is not leaked.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_from_suffix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4364-4366">Source</a><h4 class="code-header">pub fn <a href="#method.new_from_suffix_zeroed" class="fn">new_from_suffix_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the suffix of a byte slice, zeroing the
suffix.</p>
<p><code>new_from_suffix_zeroed</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code>
and that the last <code>size_of::&lt;T&gt;()</code> bytes of <code>bytes</code> are aligned to
<code>align_of::&lt;T&gt;()</code>. It consumes the last <code>size_of::&lt;T&gt;()</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the preceding bytes to the
caller. If either the length or alignment checks fail, it returns
<code>None</code>.</p>
<p>If the checks succeed, then the suffix which is consumed will be
initialized to zero. This can be useful when re-using buffers to ensure
that sensitive data previously stored in the buffer is not leaked.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+%5BT%5D%3E-1" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4369-4435">Source</a><a href="#impl-Ref%3CB,+%5BT%5D%3E-1" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_slice_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4388-4390">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_zeroed" class="fn">new_slice_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type after zeroing the bytes.</p>
<p><code>new_slice_zeroed</code> verifies that <code>bytes.len()</code> is a multiple of
<code>size_of::&lt;T&gt;()</code> and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>, and
constructs a new <code>Ref</code>. If either of these checks fail, it returns
<code>None</code>.</p>
<p>If the checks succeed, then <code>bytes</code> will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.</p>
<h5 id="panics-3"><a class="doc-anchor" href="#panics-3">§</a>Panics</h5>
<p><code>new_slice</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_from_prefix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4410-4412">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_from_prefix_zeroed" class="fn">new_slice_from_prefix_zeroed</a>(
bytes: B,
count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type from the prefix of a byte slice,
after zeroing the bytes.</p>
<p><code>new_slice_from_prefix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code> and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>. It consumes the
first <code>size_of::&lt;T&gt;() * count</code> bytes from <code>bytes</code> to construct a <code>Ref</code>,
and returns the remaining bytes to the caller. It also ensures that
<code>sizeof::&lt;T&gt;() * count</code> does not overflow a <code>usize</code>. If any of the
length, alignment, or overflow checks fail, it returns <code>None</code>.</p>
<p>If the checks succeed, then the suffix which is consumed will be
initialized to zero. This can be useful when re-using buffers to ensure
that sensitive data previously stored in the buffer is not leaked.</p>
<h5 id="panics-4"><a class="doc-anchor" href="#panics-4">§</a>Panics</h5>
<p><code>new_slice_from_prefix_zeroed</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_from_suffix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4432-4434">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_from_suffix_zeroed" class="fn">new_slice_from_suffix_zeroed</a>(
bytes: B,
count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type from the prefix of a byte slice,
after zeroing the bytes.</p>
<p><code>new_slice_from_suffix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code> and that <code>bytes</code> is aligned to <code>align_of::&lt;T&gt;()</code>. It consumes the
last <code>size_of::&lt;T&gt;() * count</code> bytes from <code>bytes</code> to construct a <code>Ref</code>,
and returns the preceding bytes to the caller. It also ensures that
<code>sizeof::&lt;T&gt;() * count</code> does not overflow a <code>usize</code>. If any of the
length, alignment, or overflow checks fail, it returns <code>None</code>.</p>
<p>If the checks succeed, then the consumed suffix will be initialized to
zero. This can be useful when re-using buffers to ensure that sensitive
data previously stored in the buffer is not leaked.</p>
<h5 id="panics-5"><a class="doc-anchor" href="#panics-5">§</a>Panics</h5>
<p><code>new_slice_from_suffix_zeroed</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-2" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4437-4474">Source</a><a href="#impl-Ref%3CB,+T%3E-2" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.Unaligned.html" title="trait zerocopy::Unaligned">Unaligned</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_unaligned" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4447-4449">Source</a><h4 class="code-header">pub fn <a href="#method.new_unaligned" class="fn">new_unaligned</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> for a type with no alignment requirement.</p>
<p><code>new_unaligned</code> verifies that <code>bytes.len() == size_of::&lt;T&gt;()</code> and
constructs a new <code>Ref</code>. If the check fails, it returns <code>None</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_unaligned_from_prefix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4459-4461">Source</a><h4 class="code-header">pub fn <a href="#method.new_unaligned_from_prefix" class="fn">new_unaligned_from_prefix</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the prefix of a byte slice for a type with
no alignment requirement.</p>
<p><code>new_unaligned_from_prefix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code>. It consumes the first <code>size_of::&lt;T&gt;()</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the remaining bytes to the
caller. If the length check fails, it returns <code>None</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_unaligned_from_suffix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4471-4473">Source</a><h4 class="code-header">pub fn <a href="#method.new_unaligned_from_suffix" class="fn">new_unaligned_from_suffix</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the suffix of a byte slice for a type with
no alignment requirement.</p>
<p><code>new_unaligned_from_suffix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code>. It consumes the last <code>size_of::&lt;T&gt;()</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the preceding bytes to the
caller. If the length check fails, it returns <code>None</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+%5BT%5D%3E-2" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4476-4529">Source</a><a href="#impl-Ref%3CB,+%5BT%5D%3E-2" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.Unaligned.html" title="trait zerocopy::Unaligned">Unaligned</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_slice_unaligned" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4491-4493">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_unaligned" class="fn">new_slice_unaligned</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type with no alignment requirement.</p>
<p><code>new_slice_unaligned</code> verifies that <code>bytes.len()</code> is a multiple of
<code>size_of::&lt;T&gt;()</code> and constructs a new <code>Ref</code>. If the check fails, it
returns <code>None</code>.</p>
<h5 id="panics-6"><a class="doc-anchor" href="#panics-6">§</a>Panics</h5>
<p><code>new_slice</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_unaligned_from_prefix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4509-4511">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_unaligned_from_prefix" class="fn">new_slice_unaligned_from_prefix</a>(
bytes: B,
count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type with no alignment requirement
from the prefix of a byte slice.</p>
<p><code>new_slice_from_prefix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code>. It consumes the first <code>size_of::&lt;T&gt;() * count</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the remaining bytes to the
caller. It also ensures that <code>sizeof::&lt;T&gt;() * count</code> does not overflow a
<code>usize</code>. If either the length, or overflow checks fail, it returns
<code>None</code>.</p>
<h5 id="panics-7"><a class="doc-anchor" href="#panics-7">§</a>Panics</h5>
<p><code>new_slice_unaligned_from_prefix</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_unaligned_from_suffix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4526-4528">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_unaligned_from_suffix" class="fn">new_slice_unaligned_from_suffix</a>(
bytes: B,
count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type with no alignment requirement
from the suffix of a byte slice.</p>
<p><code>new_slice_from_suffix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code>. It consumes the last <code>size_of::&lt;T&gt;() * count</code> bytes from <code>bytes</code>
to construct a <code>Ref</code>, and returns the remaining bytes to the caller. It
also ensures that <code>sizeof::&lt;T&gt;() * count</code> does not overflow a <code>usize</code>.
If either the length, or overflow checks fail, it returns <code>None</code>.</p>
<h5 id="panics-8"><a class="doc-anchor" href="#panics-8">§</a>Panics</h5>
<p><code>new_slice_unaligned_from_suffix</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-3" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4531-4581">Source</a><a href="#impl-Ref%3CB,+T%3E-3" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.Unaligned.html" title="trait zerocopy::Unaligned">Unaligned</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_unaligned_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4546-4548">Source</a><h4 class="code-header">pub fn <a href="#method.new_unaligned_zeroed" class="fn">new_unaligned_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> for a type with no alignment requirement, zeroing
the bytes.</p>
<p><code>new_unaligned_zeroed</code> verifies that <code>bytes.len() == size_of::&lt;T&gt;()</code> and
constructs a new <code>Ref</code>. If the check fails, it returns <code>None</code>.</p>
<p>If the check succeeds, then <code>bytes</code> will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_unaligned_from_prefix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4562-4564">Source</a><h4 class="code-header">pub fn <a href="#method.new_unaligned_from_prefix_zeroed" class="fn">new_unaligned_from_prefix_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the prefix of a byte slice for a type with
no alignment requirement, zeroing the prefix.</p>
<p><code>new_unaligned_from_prefix_zeroed</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code>. It consumes the first <code>size_of::&lt;T&gt;()</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the remaining bytes to the
caller. If the length check fails, it returns <code>None</code>.</p>
<p>If the check succeeds, then the prefix which is consumed will be
initialized to zero. This can be useful when re-using buffers to ensure
that sensitive data previously stored in the buffer is not leaked.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_unaligned_from_suffix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4578-4580">Source</a><h4 class="code-header">pub fn <a href="#method.new_unaligned_from_suffix_zeroed" class="fn">new_unaligned_from_suffix_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> from the suffix of a byte slice for a type with
no alignment requirement, zeroing the suffix.</p>
<p><code>new_unaligned_from_suffix_zeroed</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;()</code>. It consumes the last <code>size_of::&lt;T&gt;()</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the preceding bytes to the
caller. If the length check fails, it returns <code>None</code>.</p>
<p>If the check succeeds, then the suffix which is consumed will be
initialized to zero. This can be useful when re-using buffers to ensure
that sensitive data previously stored in the buffer is not leaked.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+%5BT%5D%3E-3" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4583-4657">Source</a><a href="#impl-Ref%3CB,+%5BT%5D%3E-3" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.Unaligned.html" title="trait zerocopy::Unaligned">Unaligned</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_slice_unaligned_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4603-4605">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_unaligned_zeroed" class="fn">new_slice_unaligned_zeroed</a>(bytes: B) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> for a slice type with no alignment requirement,
zeroing the bytes.</p>
<p><code>new_slice_unaligned_zeroed</code> verifies that <code>bytes.len()</code> is a multiple
of <code>size_of::&lt;T&gt;()</code> and constructs a new <code>Ref</code>. If the check fails, it
returns <code>None</code>.</p>
<p>If the check succeeds, then <code>bytes</code> will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.</p>
<h5 id="panics-9"><a class="doc-anchor" href="#panics-9">§</a>Panics</h5>
<p><code>new_slice</code> panics if <code>T</code> is a zero-sized type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_unaligned_from_prefix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4626-4631">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_unaligned_from_prefix_zeroed" class="fn">new_slice_unaligned_from_prefix_zeroed</a>(
bytes: B,
count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;, B)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type with no alignment requirement
from the prefix of a byte slice, after zeroing the bytes.</p>
<p><code>new_slice_from_prefix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code>. It consumes the first <code>size_of::&lt;T&gt;() * count</code> bytes from
<code>bytes</code> to construct a <code>Ref</code>, and returns the remaining bytes to the
caller. It also ensures that <code>sizeof::&lt;T&gt;() * count</code> does not overflow a
<code>usize</code>. If either the length, or overflow checks fail, it returns
<code>None</code>.</p>
<p>If the checks succeed, then the prefix will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.</p>
<h5 id="panics-10"><a class="doc-anchor" href="#panics-10">§</a>Panics</h5>
<p><code>new_slice_unaligned_from_prefix_zeroed</code> panics if <code>T</code> is a zero-sized
type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_slice_unaligned_from_suffix_zeroed" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4651-4656">Source</a><h4 class="code-header">pub fn <a href="#method.new_slice_unaligned_from_suffix_zeroed" class="fn">new_slice_unaligned_from_suffix_zeroed</a>(
bytes: B,
count: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(B, <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;)&gt;</h4></section></summary><div class="docblock"><p>Constructs a new <code>Ref</code> of a slice type with no alignment requirement
from the suffix of a byte slice, after zeroing the bytes.</p>
<p><code>new_slice_from_suffix</code> verifies that <code>bytes.len() &gt;= size_of::&lt;T&gt;() * count</code>. It consumes the last <code>size_of::&lt;T&gt;() * count</code> bytes from <code>bytes</code>
to construct a <code>Ref</code>, and returns the remaining bytes to the caller. It
also ensures that <code>sizeof::&lt;T&gt;() * count</code> does not overflow a <code>usize</code>.
If either the length, or overflow checks fail, it returns <code>None</code>.</p>
<p>If the checks succeed, then the suffix will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.</p>
<h5 id="panics-11"><a class="doc-anchor" href="#panics-11">§</a>Panics</h5>
<p><code>new_slice_unaligned_from_suffix_zeroed</code> panics if <code>T</code> is a zero-sized
type.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-4" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4659-4677">Source</a><a href="#impl-Ref%3CB,+T%3E-4" class="anchor">§</a><h3 class="code-header">impl&lt;'a, B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: 'a + <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_ref" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4668-4676">Source</a><h4 class="code-header">pub fn <a href="#method.into_ref" class="fn">into_ref</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;'a T</a></h4></section></summary><div class="docblock"><p>Converts this <code>Ref</code> into a reference.</p>
<p><code>into_ref</code> consumes the <code>Ref</code>, and returns a reference to <code>T</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-5" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4679-4698">Source</a><a href="#impl-Ref%3CB,+T%3E-5" class="anchor">§</a><h3 class="code-header">impl&lt;'a, B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: 'a + <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_mut" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4688-4697">Source</a><h4 class="code-header">pub fn <a href="#method.into_mut" class="fn">into_mut</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;'a mut T</a></h4></section></summary><div class="docblock"><p>Converts this <code>Ref</code> into a mutable reference.</p>
<p><code>into_mut</code> consumes the <code>Ref</code>, and returns a mutable reference to <code>T</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+%5BT%5D%3E-4" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4700-4718">Source</a><a href="#impl-Ref%3CB,+%5BT%5D%3E-4" class="anchor">§</a><h3 class="code-header">impl&lt;'a, B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: 'a + <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_slice" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4709-4717">Source</a><h4 class="code-header">pub fn <a href="#method.into_slice" class="fn">into_slice</a>(self) -&gt; &amp;'a <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a></h4></section></summary><div class="docblock"><p>Converts this <code>Ref</code> into a slice reference.</p>
<p><code>into_slice</code> consumes the <code>Ref</code>, and returns a reference to <code>[T]</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+%5BT%5D%3E-5" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4720-4740">Source</a><a href="#impl-Ref%3CB,+%5BT%5D%3E-5" class="anchor">§</a><h3 class="code-header">impl&lt;'a, B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: 'a + <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_mut_slice" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4730-4739">Source</a><h4 class="code-header">pub fn <a href="#method.into_mut_slice" class="fn">into_mut_slice</a>(self) -&gt; &amp;'a mut <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a></h4></section></summary><div class="docblock"><p>Converts this <code>Ref</code> into a mutable slice reference.</p>
<p><code>into_mut_slice</code> consumes the <code>Ref</code>, and returns a mutable reference to
<code>[T]</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-6" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4851-4861">Source</a><a href="#impl-Ref%3CB,+T%3E-6" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
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.bytes" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4858-4860">Source</a><h4 class="code-header">pub fn <a href="#method.bytes" class="fn">bytes</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>]</h4></section></summary><div class="docblock"><p>Gets the underlying bytes.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-7" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4863-4873">Source</a><a href="#impl-Ref%3CB,+T%3E-7" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
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.bytes_mut" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4870-4872">Source</a><h4 class="code-header">pub fn <a href="#method.bytes_mut" class="fn">bytes_mut</a>(&amp;mut self) -&gt; &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>]</h4></section></summary><div class="docblock"><p>Gets the underlying bytes mutably.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-8" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4875-4889">Source</a><a href="#impl-Ref%3CB,+T%3E-8" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.read" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4882-4888">Source</a><h4 class="code-header">pub fn <a href="#method.read" class="fn">read</a>(&amp;self) -&gt; T</h4></section></summary><div class="docblock"><p>Reads a copy of <code>T</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ref%3CB,+T%3E-9" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4891-4906">Source</a><a href="#impl-Ref%3CB,+T%3E-9" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.write" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4898-4905">Source</a><h4 class="code-header">pub fn <a href="#method.write" class="fn">write</a>(&amp;mut self, t: T)</h4></section></summary><div class="docblock"><p>Writes the bytes of <code>t</code> and then forgets <code>t</code>.</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-Debug-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5015-5025">Source</a><a href="#impl-Debug-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-3" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5021-5024">Source</a><a href="#method.fmt-3" 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>(&amp;self, fmt: &amp;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>&lt;'_&gt;) -&gt; <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-Debug-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5003-5013">Source</a><a href="#impl-Debug-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-2" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5009-5012">Source</a><a href="#method.fmt-2" 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>(&amp;self, fmt: &amp;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>&lt;'_&gt;) -&gt; <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-Deref-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4943-4959">Source</a><a href="#impl-Deref-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4948">Source</a><a href="#associatedtype.Target-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a></h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref-1" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4950-4958">Source</a><a href="#method.deref-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4908-4924">Source</a><a href="#impl-Deref-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4913">Source</a><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4915-4923">Source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-DerefMut-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4961-4976">Source</a><a href="#impl-DerefMut-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.deref_mut-1" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4967-4975">Source</a><a href="#method.deref_mut-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut" class="fn">deref_mut</a>(&amp;mut self) -&gt; &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a></h4></section></summary><div class='docblock'>Mutably dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-DerefMut-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4926-4941">Source</a><a href="#impl-DerefMut-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSliceMut.html" title="trait zerocopy::ByteSliceMut">ByteSliceMut</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.deref_mut" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4932-4940">Source</a><a href="#method.deref_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut" class="fn">deref_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4990-5001">Source</a><a href="#impl-Display-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,
<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4997-5000">Source</a><a href="#method.fmt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Display.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, fmt: &amp;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>&lt;'_&gt;) -&gt; <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.Display.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#4978-4988">Source</a><a href="#impl-Display-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>,</div></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/zerocopy/lib.rs.html#4984-4987">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.Display.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, fmt: &amp;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>&lt;'_&gt;) -&gt; <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.Display.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5076-5087">Source</a><a href="#impl-Ord-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp-1" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5082-5086">Source</a><a href="#method.cmp-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&amp;self, other: &amp;Self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/1.84.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#980-982">Source</a></span><a href="#method.max-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -&gt; Self<div class="where">where
Self: <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></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#1001-1003">Source</a></span><a href="#method.min-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -&gt; Self<div class="where">where
Self: <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></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#1027-1029">Source</a></span><a href="#method.clamp-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -&gt; Self<div class="where">where
Self: <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></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5063-5074">Source</a><a href="#impl-Ord-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5069-5073">Source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&amp;self, other: &amp;Self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/1.84.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#980-982">Source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -&gt; Self<div class="where">where
Self: <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></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#1001-1003">Source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -&gt; Self<div class="where">where
Self: <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></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/core/cmp.rs.html#1027-1029">Source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -&gt; Self<div class="where">where
Self: <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></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5052-5061">Source</a><a href="#impl-PartialEq-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-1" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5058-5060">Source</a><a href="#method.eq-1" 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>(&amp;self, other: &amp;Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/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-1" 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-1" 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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/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><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5041-5050">Source</a><a href="#impl-PartialEq-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></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/zerocopy/lib.rs.html#5047-5049">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>(&amp;self, other: &amp;Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/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><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5102-5113">Source</a><a href="#impl-PartialOrd-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp-1" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5108-5112">Source</a><a href="#method.partial_cmp-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&amp;self, other: &amp;Self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt-1" 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#1335">Source</a></span><a href="#method.lt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le-1" 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#1353">Source</a></span><a href="#method.le-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
<code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt-1" 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#1371">Source</a></span><a href="#method.gt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code>
operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge-1" 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#1389">Source</a></span><a href="#method.ge-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5089-5100">Source</a><a href="#impl-PartialOrd-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5095-5099">Source</a><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&amp;self, other: &amp;Self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" 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#1335">Source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" 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#1353">Source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
<code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" 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#1371">Source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code>
operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" 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#1389">Source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><section id="impl-Eq-for-Ref%3CB,+%5BT%5D%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5034-5039">Source</a><a href="#impl-Eq-for-Ref%3CB,+%5BT%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a>&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,</div></h3></section><section id="impl-Eq-for-Ref%3CB,+T%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#5027-5032">Source</a><a href="#impl-Eq-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="trait.ByteSlice.html" title="trait zerocopy::ByteSlice">ByteSlice</a>,
T: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,</div></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-Ref%3CB,+T%3E" class="impl"><a href="#impl-Freeze-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a>,
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><section id="impl-RefUnwindSafe-for-Ref%3CB,+T%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <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>,
T: <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> + ?<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><section id="impl-Send-for-Ref%3CB,+T%3E" class="impl"><a href="#impl-Send-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Sync-for-Ref%3CB,+T%3E" class="impl"><a href="#impl-Sync-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Unpin-for-Ref%3CB,+T%3E" class="impl"><a href="#impl-Unpin-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-UnwindSafe-for-Ref%3CB,+T%3E" class="impl"><a href="#impl-UnwindSafe-for-Ref%3CB,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B, T&gt; <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.Ref.html" title="struct zerocopy::Ref">Ref</a>&lt;B, T&gt;<div class="where">where
B: <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>,
T: <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> + ?<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></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&lt;T&gt; <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>(&amp;self) -&gt; <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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; 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>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; 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>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.reference.html">&amp;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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; 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) -&gt; 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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; 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>&lt;T&gt;,</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) -&gt; 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>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Receiver-for-P" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/ops/deref.rs.html#374-376">Source</a><a href="#impl-Receiver-for-P" class="anchor">§</a><h3 class="code-header">impl&lt;P, T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Receiver.html" title="trait core::ops::deref::Receiver">Receiver</a> for P<div class="where">where
P: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a>&lt;Target = T&gt; + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
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" open><summary><section id="associatedtype.Target-2" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/ops/deref.rs.html#378">Source</a><a href="#associatedtype.Target-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/ops/deref/trait.Receiver.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>arbitrary_self_types</code>)</span></div></span><div class='docblock'>The target type on which the method may be called.</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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; 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>&lt;T&gt;,</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) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;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>&lt;U&gt;&gt;::<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>&gt;</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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; 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>&lt;T&gt;,</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> = &lt;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>&lt;T&gt;&gt;::<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) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;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>&lt;T&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>