edlang/object/endian/trait.Endian.html

68 lines
36 KiB
HTML
Raw Normal View History

<!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 trait for using an endianness specification."><title>Endian in object::endian - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="object" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../object/index.html">object</a><span class="version">0.32.2</span></h2></div><h2 class="location"><a href="#">Endian</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_big_endian">from_big_endian</a></li><li><a href="#tymethod.is_big_endian">is_big_endian</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.from_little_endian">from_little_endian</a></li><li><a href="#method.is_little_endian">is_little_endian</a></li><li><a href="#method.read_i16">read_i16</a></li><li><a href="#method.read_i16_bytes">read_i16_bytes</a></li><li><a href="#method.read_i32">read_i32</a></li><li><a href="#method.read_i32_bytes">read_i32_bytes</a></li><li><a href="#method.read_i64">read_i64</a></li><li><a href="#method.read_i64_bytes">read_i64_bytes</a></li><li><a href="#method.read_u16">read_u16</a></li><li><a href="#method.read_u16_bytes">read_u16_bytes</a></li><li><a href="#method.read_u32">read_u32</a></li><li><a href="#method.read_u32_bytes">read_u32_bytes</a></li><li><a href="#method.read_u64">read_u64</a></li><li><a href="#method.read_u64_bytes">read_u64_bytes</a></li><li><a href="#method.write_i16">write_i16</a></li><li><a href="#method.write_i16_bytes">write_i16_bytes</a></li><li><a href="#method.write_i32">write_i32</a></li><li><a href="#method.write_i32_bytes">write_i32_bytes</a></li><li><a href="#method.write_i64">write_i64</a></li><li><a href="#method.write_i64_bytes">write_i64_bytes</a></li><li><a href="#method.write_u16">write_u16</a></li><li><a href="#method.write_u16_bytes">write_u16_bytes</a></li><li><a href="#method.write_u32">write_u32</a></li><li><a href="#method.write_
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../object/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">object</a>::<wbr><a href="index.html">endian</a>::<wbr><a class="trait" href="#">Endian</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/object/endian.rs.html#13-274">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Endian: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + 'static {
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 28 methods</span></summary> // Required methods
fn <a href="#tymethod.from_big_endian" class="fn">from_big_endian</a>(big_endian: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.is_big_endian" class="fn">is_big_endian</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a>;
// Provided methods
fn <a href="#method.from_little_endian" class="fn">from_little_endian</a>(little_endian: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.is_little_endian" class="fn">is_little_endian</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_u16" class="fn">read_u16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_u32" class="fn">read_u32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_u64" class="fn">read_u64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_i16" class="fn">read_i16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_i32" class="fn">read_i32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_i64" class="fn">read_i64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_u16_bytes" class="fn">read_u16_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_u32_bytes" class="fn">read_u32_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_u64_bytes" class="fn">read_u64_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_i16_bytes" class="fn">read_i16_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_i32_bytes" class="fn">read_i32_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_i64_bytes" class="fn">read_i64_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_u16" class="fn">write_u16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_u32" class="fn">write_u32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_u64" class="fn">write_u64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_i16" class="fn">write_i16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_i32" class="fn">write_i32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_i64" class="fn">write_i64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.write_u16_bytes" class="fn">write_u16_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.write_u32_bytes" class="fn">write_u32_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.write_u64_bytes" class="fn">write_u64_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.write_i16_bytes" class="fn">write_i16_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.write_i32_bytes" class="fn">write_i32_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.write_i64_bytes" class="fn">write_i64_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>] { ... }
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait for using an endianness specification.</p>
<p>Provides methods for converting between the specified endianness and
the native endianness of the target machine.</p>
<p>This trait does not require that the endianness is known at compile time.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.from_big_endian" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#17">source</a><h4 class="code-header">fn <a href="#tymethod.from_big_endian" class="fn">from_big_endian</a>(big_endian: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Construct a specification for the endianness of some values.</p>
<p>Returns <code>None</code> if the type does not support specifying the given endianness.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.is_big_endian" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#27">source</a><h4 class="code-header">fn <a href="#tymethod.is_big_endian" class="fn">is_big_endian</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return true for big endian byte order.</p>
</div></details></div><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.from_little_endian" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#22-24">source</a><h4 class="code-header">fn <a href="#method.from_little_endian" class="fn">from_little_endian</a>(little_endian: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Construct a specification for the endianness of some values.</p>
<p>Returns <code>None</code> if the type does not support specifying the given endianness.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_little_endian" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#31-33">source</a><h4 class="code-header">fn <a href="#method.is_little_endian" class="fn">is_little_endian</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return true for little endian byte order.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_u16" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#37-43">source</a><h4 class="code-header">fn <a href="#method.read_u16" class="fn">read_u16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Converts an unsigned 16 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_u32" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#47-53">source</a><h4 class="code-header">fn <a href="#method.read_u32" class="fn">read_u32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Converts an unsigned 32 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_u64" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#57-63">source</a><h4 class="code-header">fn <a href="#method.read_u64" class="fn">read_u64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Converts an unsigned 64 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_i16" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#67-73">source</a><h4 class="code-header">fn <a href="#method.read_i16" class="fn">read_i16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Converts a signed 16 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_i32" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#77-83">source</a><h4 class="code-header">fn <a href="#method.read_i32" class="fn">read_i32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Converts a signed 32 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_i64" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#87-93">source</a><h4 class="code-header">fn <a href="#method.read_i64" class="fn">read_i64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Converts a signed 64 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_u16_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#97-103">source</a><h4 class="code-header">fn <a href="#method.read_u16_bytes" class="fn">read_u16_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Converts an unaligned unsigned 16 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_u32_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#107-113">source</a><h4 class="code-header">fn <a href="#method.read_u32_bytes" class="fn">read_u32_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Converts an unaligned unsigned 32 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_u64_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#117-123">source</a><h4 class="code-header">fn <a href="#method.read_u64_bytes" class="fn">read_u64_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Converts an unaligned unsigned 64 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_i16_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#127-133">source</a><h4 class="code-header">fn <a href="#method.read_i16_bytes" class="fn">read_i16_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Converts an unaligned signed 16 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_i32_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#137-143">source</a><h4 class="code-header">fn <a href="#method.read_i32_bytes" class="fn">read_i32_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Converts an unaligned signed 32 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_i64_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#147-153">source</a><h4 class="code-header">fn <a href="#method.read_i64_bytes" class="fn">read_i64_bytes</a>(self, n: [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Converts an unaligned signed 64 bit integer to native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_u16" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#157-163">source</a><h4 class="code-header">fn <a href="#method.write_u16" class="fn">write_u16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Converts an unsigned 16 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_u32" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#167-173">source</a><h4 class="code-header">fn <a href="#method.write_u32" class="fn">write_u32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Converts an unsigned 32 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_u64" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#177-183">source</a><h4 class="code-header">fn <a href="#method.write_u64" class="fn">write_u64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Converts an unsigned 64 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_i16" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#187-193">source</a><h4 class="code-header">fn <a href="#method.write_i16" class="fn">write_i16</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Converts a signed 16 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_i32" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#197-203">source</a><h4 class="code-header">fn <a href="#method.write_i32" class="fn">write_i32</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Converts a signed 32 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_i64" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#207-213">source</a><h4 class="code-header">fn <a href="#method.write_i64" class="fn">write_i64</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Converts a signed 64 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_u16_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#217-223">source</a><h4 class="code-header">fn <a href="#method.write_u16_bytes" class="fn">write_u16_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u16.html">u16</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>]</h4></section></summary><div class="docblock"><p>Converts an unaligned unsigned 16 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_u32_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#227-233">source</a><h4 class="code-header">fn <a href="#method.write_u32_bytes" class="fn">write_u32_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u32.html">u32</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>]</h4></section></summary><div class="docblock"><p>Converts an unaligned unsigned 32 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_u64_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#237-243">source</a><h4 class="code-header">fn <a href="#method.write_u64_bytes" class="fn">write_u64_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>]</h4></section></summary><div class="docblock"><p>Converts an unaligned unsigned 64 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_i16_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#247-253">source</a><h4 class="code-header">fn <a href="#method.write_i16_bytes" class="fn">write_i16_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i16.html">i16</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">2</a>]</h4></section></summary><div class="docblock"><p>Converts an unaligned signed 16 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_i32_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#257-263">source</a><h4 class="code-header">fn <a href="#method.write_i32_bytes" class="fn">write_i32_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i32.html">i32</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">4</a>]</h4></section></summary><div class="docblock"><p>Converts an unaligned signed 32 bit integer from native endian.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_i64_bytes" class="method"><a class="src rightside" href="../../src/object/endian.rs.html#267-273">source</a><h4 class="code-header">fn <a href="#method.write_i64_bytes" class="fn">write_i64_bytes</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.i64.html">i64</a>) -&gt; [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.array.html">8</a>]</h4></section></summary><div class="docblock"><p>Converts an unaligned signed 64 bit integer from native endian.</p>
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.76.0/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Endian-for-Endianness" class="impl"><a class="src rightside" href="../../src/object/endian.rs.html#299-313">source</a><a href="#impl-Endian-for-Endianness" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Endian.html" title="trait object::endian::Endian">Endian</a> for <a class="enum" href="enum.Endianness.html" title="enum object::endian::Endianness">Endianness</a></h3></section><section id="impl-Endian-for-BigEndian" class="impl"><a class="src rightside" href="../../src/object/endian.rs.html#353-367">source</a><a href="#impl-Endian-for-BigEndian" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Endian.html" title="trait object::endian::Endian">Endian</a> for <a class="struct" href="struct.BigEndian.html" title="struct object::endian::BigEndian">BigEndian</a></h3></section><section id="impl-Endian-for-LittleEndian" class="impl"><a class="src rightside" href="../../src/object/endian.rs.html#326-340">source</a><a href="#impl-Endian-for-LittleEndian" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Endian.html" title="trait object::endian::Endian">Endian</a> for <a class="struct" href="struct.LittleEndian.html" title="struct object::endian::LittleEndian">LittleEndian</a></h3></section></div><script src="../../trait.impl/object/endian/trait.Endian.js" async></script></section></div></main></body></html>