mpvrc/zerocopy/trait.AsBytes.html

249 lines
No EOL
65 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="Types that can be viewed as an immutable slice of initialized bytes."><title>AsBytes 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 trait"><!--[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="#">AsBytes</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#implementation" title="Implementation">Implementation</a></li><li><a href="#safety" title="Safety">Safety</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.as_bytes" title="as_bytes">as_bytes</a></li><li><a href="#method.as_bytes_mut" title="as_bytes_mut">as_bytes_mut</a></li><li><a href="#method.write_to" title="write_to">write_to</a></li><li><a href="#method.write_to_prefix" title="write_to_prefix">write_to_prefix</a></li><li><a href="#method.write_to_suffix" title="write_to_suffix">write_to_suffix</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-AsBytes-for-()" title="()">()</a></li><li><a href="#impl-AsBytes-for-ManuallyDrop%3CT%3E" title="ManuallyDrop&#60;T&#62;">ManuallyDrop&#60;T&#62;</a></li><li><a href="#impl-AsBytes-for-NonZero%3Ci128%3E" title="NonZeroI128">NonZeroI128</a></li><li><a href="#impl-AsBytes-for-NonZero%3Ci16%3E" title="NonZeroI16">NonZeroI16</a></li><li><a href="#impl-AsBytes-for-NonZero%3Ci32%3E" title="NonZeroI32">NonZeroI32</a></li><li><a href="#impl-AsBytes-for-NonZero%3Ci64%3E" title="NonZeroI64">NonZeroI64</a></li><li><a href="#impl-AsBytes-for-NonZero%3Ci8%3E" title="NonZeroI8">NonZeroI8</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cisize%3E" title="NonZeroIsize">NonZeroIsize</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cu128%3E" title="NonZeroU128">NonZeroU128</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cu16%3E" title="NonZeroU16">NonZeroU16</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cu32%3E" title="NonZeroU32">NonZeroU32</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cu64%3E" title="NonZeroU64">NonZeroU64</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cu8%3E" title="NonZeroU8">NonZeroU8</a></li><li><a href="#impl-AsBytes-for-NonZero%3Cusize%3E" title="NonZeroUsize">NonZeroUsize</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci128%3E%3E" title="Option&#60;NonZeroI128&#62;">Option&#60;NonZeroI128&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci16%3E%3E" title="Option&#60;NonZeroI16&#62;">Option&#60;NonZeroI16&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci32%3E%3E" title="Option&#60;NonZeroI32&#62;">Option&#60;NonZeroI32&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci64%3E%3E" title="Option&#60;NonZeroI64&#62;">Option&#60;NonZeroI64&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci8%3E%3E" title="Option&#60;NonZeroI8&#62;">Option&#60;NonZeroI8&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cisize%3E%3E" title="Option&#60;NonZeroIsize&#62;">Option&#60;NonZeroIsize&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu128%3E%3E" title="Option&#60;NonZeroU128&#62;">Option&#60;NonZeroU128&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu16%3E%3E" title="Option&#60;NonZeroU16&#62;">Option&#60;NonZeroU16&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu32%3E%3E" title="Option&#60;NonZeroU32&#62;">Option&#60;NonZeroU32&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu64%3E%3E" title="Option&#60;NonZeroU64&#62;">Option&#60;NonZeroU64&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu8%3E%3E" title="Option&#60;NonZeroU8&#62;">Option&#60;NonZeroU8&#62;</a></li><li><a href="#impl-AsBytes-for-Option%3CNonZero%3Cusize%3E%3E" title="Option&#60;NonZeroUsize&#62;">Option&#60;NonZeroUsize&#62;</a></li><li><a href="#impl-AsBytes-for-PhantomData%3CT%3E" title="PhantomData&#60;T&#62;">PhantomData&#60;T&#62;</a></li><li><a href="#impl-AsBytes-for-Wrapping%3CT%3E" title="Wrapping&#60;T&#62;">Wrapping&#60;T&#62;</a></li><li><a href="#impl-AsBytes-for-%5BT;+N%5D" title="[T; N]">[T; N]</a></li><li><a href="#impl-AsBytes-for-%5BT%5D" title="[T]">[T]</a></li><li><a href="#impl-AsBytes-for-__m128" title="__m128">__m128</a></li><li><a href="#impl-AsBytes-for-__m128d" title="__m128d">__m128d</a></li><li><a href="#impl-AsBytes-for-__m128i" title="__m128i">__m128i</a></li><li><a href="#impl-AsBytes-for-__m256" title="__m256">__m256</a></li><li><a href="#impl-AsBytes-for-__m256d" title="__m256d">__m256d</a></li><li><a href="#impl-AsBytes-for-__m256i" title="__m256i">__m256i</a></li><li><a href="#impl-AsBytes-for-bool" title="bool">bool</a></li><li><a href="#impl-AsBytes-for-char" title="char">char</a></li><li><a href="#impl-AsBytes-for-f32" title="f32">f32</a></li><li><a href="#impl-AsBytes-for-f64" title="f64">f64</a></li><li><a href="#impl-AsBytes-for-i128" title="i128">i128</a></li><li><a href="#impl-AsBytes-for-i16" title="i16">i16</a></li><li><a href="#impl-AsBytes-for-i32" title="i32">i32</a></li><li><a href="#impl-AsBytes-for-i64" title="i64">i64</a></li><li><a href="#impl-AsBytes-for-i8" title="i8">i8</a></li><li><a href="#impl-AsBytes-for-isize" title="isize">isize</a></li><li><a href="#impl-AsBytes-for-str" title="str">str</a></li><li><a href="#impl-AsBytes-for-u128" title="u128">u128</a></li><li><a href="#impl-AsBytes-for-u16" title="u16">u16</a></li><li><a href="#impl-AsBytes-for-u32" title="u32">u32</a></li><li><a href="#impl-AsBytes-for-u64" title="u64">u64</a></li><li><a href="#impl-AsBytes-for-u8" title="u8">u8</a></li><li><a href="#impl-AsBytes-for-usize" title="usize">usize</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 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>Trait <span class="trait">AsBytes</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#2676-2997">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe trait AsBytes {
// Provided methods
fn <a href="#method.as_bytes" class="fn">as_bytes</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.as_bytes_mut" class="fn">as_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>]
<span class="where">where Self: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_to" class="fn">write_to</a>(&amp;self, bytes: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</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="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.write_to_prefix" class="fn">write_to_prefix</a>(&amp;self, bytes: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</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="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.write_to_suffix" class="fn">write_to_suffix</a>(&amp;self, bytes: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</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="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a>&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Types that can be viewed as an immutable slice of initialized bytes.</p>
<p>Any <code>AsBytes</code> type can be viewed as a slice of initialized bytes of the same
size. This is useful for efficiently serializing structured data as raw
bytes.</p>
<h2 id="implementation"><a class="doc-anchor" href="#implementation">§</a>Implementation</h2>
<p><strong>Do not implement this trait yourself!</strong> Instead, use
<a href="derive.AsBytes.html" title="derive zerocopy::AsBytes"><code>#[derive(AsBytes)]</code></a> (requires the <code>derive</code> Cargo feature); e.g.:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[derive(AsBytes)]
#[repr(C)]
</span><span class="kw">struct </span>MyStruct {
...
}
<span class="attr">#[derive(AsBytes)]
#[repr(u8)]
</span><span class="kw">enum </span>MyEnum {
...
}
<span class="attr">#[derive(AsBytes)]
#[repr(C)]
</span><span class="kw">union </span>MyUnion {
...
}</code></pre></div>
<p>This derive performs a sophisticated, compile-time safety analysis to
determine whether a type is <code>AsBytes</code>. See the <a href="derive.AsBytes.html" title="derive zerocopy::AsBytes">derive
documentation</a> for guidance on how to interpret error messages
produced by the derives analysis.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p><em>This section describes what is required in order for <code>T: AsBytes</code>, and
what unsafe code may assume of such types. If you dont plan on implementing
<code>AsBytes</code> manually, and you dont plan on writing unsafe code that
operates on <code>AsBytes</code> types, then you dont need to read this section.</em></p>
<p>If <code>T: AsBytes</code>, then unsafe code may assume that:</p>
<ul>
<li>It is sound to treat any <code>t: T</code> as an immutable <code>[u8]</code> of length
<code>size_of_val(t)</code>.</li>
<li>Given <code>t: &amp;T</code>, it is sound to construct a <code>b: &amp;[u8]</code> where <code>b.len() == size_of_val(t)</code> at the same address as <code>t</code>, and it is sound for both <code>b</code>
and <code>t</code> to be live at the same time.</li>
</ul>
<p>If a type is marked as <code>AsBytes</code> which violates this contract, it may cause
undefined behavior.</p>
<p><code>#[derive(AsBytes)]</code> only permits <a href="derive.AsBytes.html#analysis" title="derive zerocopy::AsBytes">types which satisfy these
requirements</a>.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.as_bytes" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#2720-2748">Source</a><h4 class="code-header">fn <a href="#method.as_bytes" class="fn">as_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 bytes of this value.</p>
<p><code>as_bytes</code> provides access to the bytes of this value as an immutable
byte slice.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerocopy::AsBytes;
<span class="attr">#[derive(AsBytes)]
#[repr(C)]
</span><span class="kw">struct </span>PacketHeader {
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">let </span>header = PacketHeader {
src_port: [<span class="number">0</span>, <span class="number">1</span>],
dst_port: [<span class="number">2</span>, <span class="number">3</span>],
length: [<span class="number">4</span>, <span class="number">5</span>],
checksum: [<span class="number">6</span>, <span class="number">7</span>],
};
<span class="kw">let </span>bytes = header.as_bytes();
<span class="macro">assert_eq!</span>(bytes, [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>]);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_bytes_mut" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#2792-2822">Source</a><h4 class="code-header">fn <a href="#method.as_bytes_mut" class="fn">as_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>]<div class="where">where
Self: <a class="trait" href="trait.FromBytes.html" title="trait zerocopy::FromBytes">FromBytes</a>,</div></h4></section></summary><div class="docblock"><p>Gets the bytes of this value mutably.</p>
<p><code>as_bytes_mut</code> provides access to the bytes of this value as a mutable
byte slice.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerocopy::AsBytes;
<span class="attr">#[derive(AsBytes, FromZeroes, FromBytes)]
#[repr(C)]
</span><span class="kw">struct </span>PacketHeader {
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">let </span><span class="kw-2">mut </span>header = PacketHeader {
src_port: [<span class="number">0</span>, <span class="number">1</span>],
dst_port: [<span class="number">2</span>, <span class="number">3</span>],
length: [<span class="number">4</span>, <span class="number">5</span>],
checksum: [<span class="number">6</span>, <span class="number">7</span>],
};
<span class="kw">let </span>bytes = header.as_bytes_mut();
<span class="macro">assert_eq!</span>(bytes, [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>]);
bytes.reverse();
<span class="macro">assert_eq!</span>(header, PacketHeader {
src_port: [<span class="number">7</span>, <span class="number">6</span>],
dst_port: [<span class="number">5</span>, <span class="number">4</span>],
length: [<span class="number">3</span>, <span class="number">2</span>],
checksum: [<span class="number">1</span>, <span class="number">0</span>],
});</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_to" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#2871-2878">Source</a><h4 class="code-header">fn <a href="#method.write_to" class="fn">write_to</a>(&amp;self, bytes: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</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="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>Writes a copy of <code>self</code> to <code>bytes</code>.</p>
<p>If <code>bytes.len() != size_of_val(self)</code>, <code>write_to</code> returns <code>None</code>.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerocopy::AsBytes;
<span class="attr">#[derive(AsBytes)]
#[repr(C)]
</span><span class="kw">struct </span>PacketHeader {
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">let </span>header = PacketHeader {
src_port: [<span class="number">0</span>, <span class="number">1</span>],
dst_port: [<span class="number">2</span>, <span class="number">3</span>],
length: [<span class="number">4</span>, <span class="number">5</span>],
checksum: [<span class="number">6</span>, <span class="number">7</span>],
};
<span class="kw">let </span><span class="kw-2">mut </span>bytes = [<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>];
header.write_to(<span class="kw-2">&amp;mut </span>bytes[..]);
<span class="macro">assert_eq!</span>(bytes, [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>]);</code></pre></div>
<p>If too many or too few target bytes are provided, <code>write_to</code> returns
<code>None</code> and leaves the target bytes unmodified:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>excessive_bytes = <span class="kw-2">&amp;mut </span>[<span class="number">0u8</span>; <span class="number">128</span>][..];
<span class="kw">let </span>write_result = header.write_to(excessive_bytes);
<span class="macro">assert!</span>(write_result.is_none());
<span class="macro">assert_eq!</span>(excessive_bytes, [<span class="number">0u8</span>; <span class="number">128</span>]);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_to_prefix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#2928-2932">Source</a><h4 class="code-header">fn <a href="#method.write_to_prefix" class="fn">write_to_prefix</a>(&amp;self, bytes: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</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="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>Writes a copy of <code>self</code> to the prefix of <code>bytes</code>.</p>
<p><code>write_to_prefix</code> writes <code>self</code> to the first <code>size_of_val(self)</code> bytes
of <code>bytes</code>. If <code>bytes.len() &lt; size_of_val(self)</code>, it returns <code>None</code>.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerocopy::AsBytes;
<span class="attr">#[derive(AsBytes)]
#[repr(C)]
</span><span class="kw">struct </span>PacketHeader {
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">let </span>header = PacketHeader {
src_port: [<span class="number">0</span>, <span class="number">1</span>],
dst_port: [<span class="number">2</span>, <span class="number">3</span>],
length: [<span class="number">4</span>, <span class="number">5</span>],
checksum: [<span class="number">6</span>, <span class="number">7</span>],
};
<span class="kw">let </span><span class="kw-2">mut </span>bytes = [<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>];
header.write_to_prefix(<span class="kw-2">&amp;mut </span>bytes[..]);
<span class="macro">assert_eq!</span>(bytes, [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>, <span class="number">0</span>, <span class="number">0</span>]);</code></pre></div>
<p>If insufficient target bytes are provided, <code>write_to_prefix</code> returns
<code>None</code> and leaves the target bytes unmodified:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>insufficent_bytes = <span class="kw-2">&amp;mut </span>[<span class="number">0</span>, <span class="number">0</span>][..];
<span class="kw">let </span>write_result = header.write_to_suffix(insufficent_bytes);
<span class="macro">assert!</span>(write_result.is_none());
<span class="macro">assert_eq!</span>(insufficent_bytes, [<span class="number">0</span>, <span class="number">0</span>]);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_to_suffix" class="method"><a class="src rightside" href="../src/zerocopy/lib.rs.html#2989-2996">Source</a><h4 class="code-header">fn <a href="#method.write_to_suffix" class="fn">write_to_suffix</a>(&amp;self, bytes: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</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="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>Writes a copy of <code>self</code> to the suffix of <code>bytes</code>.</p>
<p><code>write_to_suffix</code> writes <code>self</code> to the last <code>size_of_val(self)</code> bytes of
<code>bytes</code>. If <code>bytes.len() &lt; size_of_val(self)</code>, it returns <code>None</code>.</p>
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerocopy::AsBytes;
<span class="attr">#[derive(AsBytes)]
#[repr(C)]
</span><span class="kw">struct </span>PacketHeader {
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">let </span>header = PacketHeader {
src_port: [<span class="number">0</span>, <span class="number">1</span>],
dst_port: [<span class="number">2</span>, <span class="number">3</span>],
length: [<span class="number">4</span>, <span class="number">5</span>],
checksum: [<span class="number">6</span>, <span class="number">7</span>],
};
<span class="kw">let </span><span class="kw-2">mut </span>bytes = [<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>];
header.write_to_suffix(<span class="kw-2">&amp;mut </span>bytes[..]);
<span class="macro">assert_eq!</span>(bytes, [<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>]);
<span class="kw">let </span><span class="kw-2">mut </span>insufficent_bytes = <span class="kw-2">&amp;mut </span>[<span class="number">0</span>, <span class="number">0</span>][..];
<span class="kw">let </span>write_result = header.write_to_suffix(insufficent_bytes);
<span class="macro">assert!</span>(write_result.is_none());
<span class="macro">assert_eq!</span>(insufficent_bytes, [<span class="number">0</span>, <span class="number">0</span>]);</code></pre></div>
<p>If insufficient target bytes are provided, <code>write_to_suffix</code> returns
<code>None</code> and leaves the target bytes unmodified:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>insufficent_bytes = <span class="kw-2">&amp;mut </span>[<span class="number">0</span>, <span class="number">0</span>][..];
<span class="kw">let </span>write_result = header.write_to_suffix(insufficent_bytes);
<span class="macro">assert!</span>(write_result.is_none());
<span class="macro">assert_eq!</span>(insufficent_bytes, [<span class="number">0</span>, <span class="number">0</span>]);</code></pre></div>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.1/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><section id="impl-AsBytes-for-Option%3CNonZero%3Ci8%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci8%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI8.html" title="type core::num::nonzero::NonZeroI8">NonZeroI8</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Ci16%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci16%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI16.html" title="type core::num::nonzero::NonZeroI16">NonZeroI16</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Ci32%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci32%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI32.html" title="type core::num::nonzero::NonZeroI32">NonZeroI32</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Ci64%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci64%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI64.html" title="type core::num::nonzero::NonZeroI64">NonZeroI64</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Ci128%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Ci128%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI128.html" title="type core::num::nonzero::NonZeroI128">NonZeroI128</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cisize%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cisize%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroIsize.html" title="type core::num::nonzero::NonZeroIsize">NonZeroIsize</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cu8%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu8%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU8.html" title="type core::num::nonzero::NonZeroU8">NonZeroU8</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cu16%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu16%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU16.html" title="type core::num::nonzero::NonZeroU16">NonZeroU16</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cu32%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu32%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU32.html" title="type core::num::nonzero::NonZeroU32">NonZeroU32</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cu64%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu64%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU64.html" title="type core::num::nonzero::NonZeroU64">NonZeroU64</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cu128%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cu128%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU128.html" title="type core::num::nonzero::NonZeroU128">NonZeroU128</a>&gt;</h3></section><section id="impl-AsBytes-for-Option%3CNonZero%3Cusize%3E%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3309-3342">Source</a><a href="#impl-AsBytes-for-Option%3CNonZero%3Cusize%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <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="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroUsize.html" title="type core::num::nonzero::NonZeroUsize">NonZeroUsize</a>&gt;</h3></section><section id="impl-AsBytes-for-bool" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3093-3145">Source</a><a href="#impl-AsBytes-for-bool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.bool.html">bool</a></h3></section><section id="impl-AsBytes-for-char" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3146-3191">Source</a><a href="#impl-AsBytes-for-char" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.char.html">char</a></h3></section><section id="impl-AsBytes-for-f32" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-f32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.f32.html">f32</a></h3></section><section id="impl-AsBytes-for-f64" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-f64" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.f64.html">f64</a></h3></section><section id="impl-AsBytes-for-i8" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-i8" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.i8.html">i8</a></h3></section><section id="impl-AsBytes-for-i16" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-i16" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.i16.html">i16</a></h3></section><section id="impl-AsBytes-for-i32" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-i32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.i32.html">i32</a></h3></section><section id="impl-AsBytes-for-i64" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-i64" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.i64.html">i64</a></h3></section><section id="impl-AsBytes-for-i128" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-i128" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.i128.html">i128</a></h3></section><section id="impl-AsBytes-for-isize" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-isize" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.isize.html">isize</a></h3></section><section id="impl-AsBytes-for-str" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3192-3232">Source</a><a href="#impl-AsBytes-for-str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.str.html">str</a></h3></section><section id="impl-AsBytes-for-u8" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-u8" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a></h3></section><section id="impl-AsBytes-for-u16" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-u16" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u16.html">u16</a></h3></section><section id="impl-AsBytes-for-u32" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-u32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u32.html">u32</a></h3></section><section id="impl-AsBytes-for-u64" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-u64" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u64.html">u64</a></h3></section><section id="impl-AsBytes-for-u128" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-u128" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u128.html">u128</a></h3></section><section id="impl-AsBytes-for-()" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3028-3040">Source</a><a href="#impl-AsBytes-for-()" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.unit.html">()</a></h3></section><section id="impl-AsBytes-for-usize" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3042-3091">Source</a><a href="#impl-AsBytes-for-usize" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a></h3></section><section id="impl-AsBytes-for-__m128" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3718-3721">Source</a><a href="#impl-AsBytes-for-__m128" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/core_arch/x86/struct.__m128.html" title="struct core::core_arch::x86::__m128">__m128</a></h3></section><section id="impl-AsBytes-for-__m128d" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3718-3721">Source</a><a href="#impl-AsBytes-for-__m128d" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/core_arch/x86/struct.__m128d.html" title="struct core::core_arch::x86::__m128d">__m128d</a></h3></section><section id="impl-AsBytes-for-__m128i" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3718-3721">Source</a><a href="#impl-AsBytes-for-__m128i" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/core_arch/x86/struct.__m128i.html" title="struct core::core_arch::x86::__m128i">__m128i</a></h3></section><section id="impl-AsBytes-for-__m256" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3718-3721">Source</a><a href="#impl-AsBytes-for-__m256" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/core_arch/x86/struct.__m256.html" title="struct core::core_arch::x86::__m256">__m256</a></h3></section><section id="impl-AsBytes-for-__m256d" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3718-3721">Source</a><a href="#impl-AsBytes-for-__m256d" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/core_arch/x86/struct.__m256d.html" title="struct core::core_arch::x86::__m256d">__m256d</a></h3></section><section id="impl-AsBytes-for-__m256i" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3718-3721">Source</a><a href="#impl-AsBytes-for-__m256i" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/core_arch/x86/struct.__m256i.html" title="struct core::core_arch::x86::__m256i">__m256i</a></h3></section><section id="impl-AsBytes-for-NonZero%3Ci8%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Ci8%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI8.html" title="type core::num::nonzero::NonZeroI8">NonZeroI8</a></h3></section><section id="impl-AsBytes-for-NonZero%3Ci16%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Ci16%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI16.html" title="type core::num::nonzero::NonZeroI16">NonZeroI16</a></h3></section><section id="impl-AsBytes-for-NonZero%3Ci32%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Ci32%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI32.html" title="type core::num::nonzero::NonZeroI32">NonZeroI32</a></h3></section><section id="impl-AsBytes-for-NonZero%3Ci64%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Ci64%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI64.html" title="type core::num::nonzero::NonZeroI64">NonZeroI64</a></h3></section><section id="impl-AsBytes-for-NonZero%3Ci128%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Ci128%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroI128.html" title="type core::num::nonzero::NonZeroI128">NonZeroI128</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cisize%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cisize%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroIsize.html" title="type core::num::nonzero::NonZeroIsize">NonZeroIsize</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cu8%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cu8%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU8.html" title="type core::num::nonzero::NonZeroU8">NonZeroU8</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cu16%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cu16%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU16.html" title="type core::num::nonzero::NonZeroU16">NonZeroU16</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cu32%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cu32%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU32.html" title="type core::num::nonzero::NonZeroU32">NonZeroU32</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cu64%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cu64%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU64.html" title="type core::num::nonzero::NonZeroU64">NonZeroU64</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cu128%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cu128%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroU128.html" title="type core::num::nonzero::NonZeroU128">NonZeroU128</a></h3></section><section id="impl-AsBytes-for-NonZero%3Cusize%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3234-3308">Source</a><a href="#impl-AsBytes-for-NonZero%3Cusize%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroUsize.html" title="type core::num::nonzero::NonZeroUsize">NonZeroUsize</a></h3></section><section id="impl-AsBytes-for-%5BT%5D" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3527-3595">Source</a><a href="#impl-AsBytes-for-%5BT%5D" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.slice.html">[T]</a></h3></section><section id="impl-AsBytes-for-Wrapping%3CT%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3404-3464">Source</a><a href="#impl-AsBytes-for-Wrapping%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/num/wrapping/struct.Wrapping.html" title="struct core::num::wrapping::Wrapping">Wrapping</a>&lt;T&gt;</h3></section><section id="impl-AsBytes-for-ManuallyDrop%3CT%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3492-3526">Source</a><a href="#impl-AsBytes-for-ManuallyDrop%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;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> + <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/mem/manually_drop/struct.ManuallyDrop.html" title="struct core::mem::manually_drop::ManuallyDrop">ManuallyDrop</a>&lt;T&gt;</h3></section><section id="impl-AsBytes-for-PhantomData%3CT%3E" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3381-3403">Source</a><a href="#impl-AsBytes-for-PhantomData%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;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; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;T&gt;</h3></section><section id="impl-AsBytes-for-%5BT;+N%5D" class="impl"><a class="src rightside" href="../src/zerocopy/lib.rs.html#3527-3595">Source</a><a href="#impl-AsBytes-for-%5BT;+N%5D" class="anchor">§</a><h3 class="code-header">impl&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.usize.html">usize</a>, T: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">[T; N]</a></h3></section><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsBytes-for-F32%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#551-564">Source</a><a href="#impl-AsBytes-for-F32%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.F32.html" title="struct zerocopy::byteorder::F32">F32</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">4</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-F64%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#565">Source</a><a href="#impl-AsBytes-for-F64%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.F64.html" title="struct zerocopy::byteorder::F64">F64</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">8</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-I16%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#508-521">Source</a><a href="#impl-AsBytes-for-I16%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.I16.html" title="struct zerocopy::byteorder::I16">I16</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">2</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-I32%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#522-535">Source</a><a href="#impl-AsBytes-for-I32%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.I32.html" title="struct zerocopy::byteorder::I32">I32</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">4</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-I64%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#536-549">Source</a><a href="#impl-AsBytes-for-I64%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.I64.html" title="struct zerocopy::byteorder::I64">I64</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">8</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-I128%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#550">Source</a><a href="#impl-AsBytes-for-I128%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.I128.html" title="struct zerocopy::byteorder::I128">I128</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">16</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-U16%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#465-478">Source</a><a href="#impl-AsBytes-for-U16%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.U16.html" title="struct zerocopy::byteorder::U16">U16</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">2</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-U32%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#479-492">Source</a><a href="#impl-AsBytes-for-U32%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.U32.html" title="struct zerocopy::byteorder::U32">U32</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">4</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-U64%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#493-506">Source</a><a href="#impl-AsBytes-for-U64%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.U64.html" title="struct zerocopy::byteorder::U64">U64</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">8</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-U128%3CO%3E" class="impl"><a class="src rightside" href="../src/zerocopy/byteorder.rs.html#507">Source</a><a href="#impl-AsBytes-for-U128%3CO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;O&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="byteorder/struct.U128.html" title="struct zerocopy::byteorder::U128">U128</a>&lt;O&gt;<div class="where">where
[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/core/primitive.array.html">16</a>]: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,
<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;O&gt;: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section><section id="impl-AsBytes-for-Unalign%3CT%3E" class="impl"><a class="src rightside" href="../src/zerocopy/wrappers.rs.html#63">Source</a><a href="#impl-AsBytes-for-Unalign%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a> for <a class="struct" href="struct.Unalign.html" title="struct zerocopy::Unalign">Unalign</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="trait.AsBytes.html" title="trait zerocopy::AsBytes">AsBytes</a>,</div></h3></section></div><script src="../trait.impl/zerocopy/trait.AsBytes.js" data-ignore-extern-crates="core" async></script></section></div></main></body></html>