Files
google-apis-rs/bytes/buf/trait.Buf.html
2024-03-05 21:06:01 +01:00

621 lines
122 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="Read bytes from a buffer."><title>Buf in bytes::buf - 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="bytes" 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="../../bytes/index.html">bytes</a><span class="version">1.5.0</span></h2></div><h2 class="location"><a href="#">Buf</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.advance">advance</a></li><li><a href="#tymethod.chunk">chunk</a></li><li><a href="#tymethod.remaining">remaining</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.chain">chain</a></li><li><a href="#method.chunks_vectored">chunks_vectored</a></li><li><a href="#method.copy_to_bytes">copy_to_bytes</a></li><li><a href="#method.copy_to_slice">copy_to_slice</a></li><li><a href="#method.get_f32">get_f32</a></li><li><a href="#method.get_f32_le">get_f32_le</a></li><li><a href="#method.get_f32_ne">get_f32_ne</a></li><li><a href="#method.get_f64">get_f64</a></li><li><a href="#method.get_f64_le">get_f64_le</a></li><li><a href="#method.get_f64_ne">get_f64_ne</a></li><li><a href="#method.get_i128">get_i128</a></li><li><a href="#method.get_i128_le">get_i128_le</a></li><li><a href="#method.get_i128_ne">get_i128_ne</a></li><li><a href="#method.get_i16">get_i16</a></li><li><a href="#method.get_i16_le">get_i16_le</a></li><li><a href="#method.get_i16_ne">get_i16_ne</a></li><li><a href="#method.get_i32">get_i32</a></li><li><a href="#method.get_i32_le">get_i32_le</a></li><li><a href="#method.get_i32_ne">get_i32_ne</a></li><li><a href="#method.get_i64">get_i64</a></li><li><a href="#method.get_i64_le">get_i64_le</a></li><li><a href="#method.get_i64_ne">get_i64_ne</a></li><li><a href="#method.get_i8">get_i8</a></li><li><a href="#method.get_int">get_int</a></li><li><a href="#method.get_int_le">get_int_le</a></li><li><a href="#method.get_int_ne">get_int_ne</a></li><li><a href="#method.get_u128">get_u128</a></li><li><a href="#method.get_u128_le">get_u128_le</a></li><li><a href="#method.get_u128_ne">get_u128_ne</a></li><li><a href="#method.get_u16">get_u16</a></li><li><a href="#method.get_u16_le">get_u16_le</a></li><li><a href="#method.get_u16_ne">get_u16_ne</a></li><li><a href="#method.get_u32">get_u32</a></li><li><a href="#method.get_u32_le">get_u32_le</a></li><li><a href="#method.get_u32_ne">get_u32_ne</a></li><li><a href="#method.get_u64">get_u64</a></li><li><a href="#method.get_u64_le">get_u64_le</a></li><li><a href="#method.get_u64_ne">get_u64_ne</a></li><li><a href="#method.get_u8">get_u8</a></li><li><a href="#method.get_uint">get_uint</a></li><li><a href="#method.get_uint_le">get_uint_le</a></li><li><a href="#method.get_uint_ne">get_uint_ne</a></li><li><a href="#method.has_remaining">has_remaining</a></li><li><a href="#method.reader">reader</a></li><li><a href="#method.take">take</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Buf-for-%26%5Bu8%5D">&amp;[u8]</a></li><li><a href="#impl-Buf-for-%26mut+T">&amp;mut T</a></li><li><a href="#impl-Buf-for-Box%3CT%3E">Box&lt;T&gt;</a></li><li><a href="#impl-Buf-for-Cursor%3CT%3E">Cursor&lt;T&gt;</a></li><li><a href="#impl-Buf-for-VecDeque%3Cu8%3E">VecDeque&lt;u8&gt;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In bytes::buf</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../bytes/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">bytes</a>::<wbr><a href="index.html">buf</a>::<wbr><a class="trait" href="#">Buf</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/bytes/buf/buf_impl.rs.html#76-1194">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 Buf {
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 48 methods</span></summary> // Required methods
fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a>;
<span class="item-spacer"></span> fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>);
// Provided methods
fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a>&lt;'a&gt;(&amp;'a self, dst: &amp;mut [<a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'a&gt;]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.has_remaining" class="fn">has_remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&amp;mut self, dst: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>]) { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u8" class="fn">get_u8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i8" class="fn">get_i8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i8.html">i8</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u16" class="fn">get_u16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u16_le" class="fn">get_u16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u16_ne" class="fn">get_u16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i16" class="fn">get_i16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i16_le" class="fn">get_i16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i16_ne" class="fn">get_i16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u32" class="fn">get_u32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u32_le" class="fn">get_u32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u32_ne" class="fn">get_u32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i32" class="fn">get_i32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i32_le" class="fn">get_i32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i32_ne" class="fn">get_i32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u64" class="fn">get_u64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u64_le" class="fn">get_u64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u64_ne" class="fn">get_u64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i64" class="fn">get_i64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i64_le" class="fn">get_i64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i64_ne" class="fn">get_i64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u128" class="fn">get_u128</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u128.html">u128</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u128_le" class="fn">get_u128_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u128.html">u128</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_u128_ne" class="fn">get_u128_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u128.html">u128</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i128" class="fn">get_i128</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i128.html">i128</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i128_le" class="fn">get_i128_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i128.html">i128</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_i128_ne" class="fn">get_i128_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i128.html">i128</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_uint" class="fn">get_uint</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_uint_le" class="fn">get_uint_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_uint_ne" class="fn">get_uint_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_int" class="fn">get_int</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_int_le" class="fn">get_int_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_int_ne" class="fn">get_int_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_f32" class="fn">get_f32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f32.html">f32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_f32_le" class="fn">get_f32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f32.html">f32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_f32_ne" class="fn">get_f32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f32.html">f32</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_f64" class="fn">get_f64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f64.html">f64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_f64_le" class="fn">get_f64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f64.html">f64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.get_f64_ne" class="fn">get_f64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f64.html">f64</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.copy_to_bytes" class="fn">copy_to_bytes</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../struct.Bytes.html" title="struct bytes::Bytes">Bytes</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.take" class="fn">take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="struct.Take.html" title="struct bytes::buf::Take">Take</a>&lt;Self&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.chain" class="fn">chain</a>&lt;U: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>&gt;(self, next: U) -&gt; <a class="struct" href="struct.Chain.html" title="struct bytes::buf::Chain">Chain</a>&lt;Self, U&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.reader" class="fn">reader</a>(self) -&gt; <a class="struct" href="struct.Reader.html" title="struct bytes::buf::Reader">Reader</a>&lt;Self&gt; <a href="#" class="tooltip" data-notable-ty="Reader&lt;Self&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Read bytes from a buffer.</p>
<p>A buffer stores bytes in memory such that read operations are infallible.
The underlying storage may or may not be in contiguous memory. A <code>Buf</code> value
is a cursor into the buffer. Reading from <code>Buf</code> advances the cursor
position. It can be thought of as an efficient <code>Iterator</code> for collections of
bytes.</p>
<p>The simplest <code>Buf</code> is a <code>&amp;[u8]</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..];
<span class="macro">assert_eq!</span>(<span class="string">b'h'</span>, buf.get_u8());
<span class="macro">assert_eq!</span>(<span class="string">b'e'</span>, buf.get_u8());
<span class="macro">assert_eq!</span>(<span class="string">b'l'</span>, buf.get_u8());
<span class="kw">let </span><span class="kw-2">mut </span>rest = [<span class="number">0</span>; <span class="number">8</span>];
buf.copy_to_slice(<span class="kw-2">&amp;mut </span>rest);
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>rest[..], <span class="kw-2">&amp;</span><span class="string">b"lo world"</span>[..]);</code></pre></div>
</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.remaining" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#102">source</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of bytes between the current position and the end of
the buffer.</p>
<p>This value is greater than or equal to the length of the slice returned
by <code>chunk()</code>.</p>
<h5 id="examples"><a href="#examples">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..];
<span class="macro">assert_eq!</span>(buf.remaining(), <span class="number">11</span>);
buf.get_u8();
<span class="macro">assert_eq!</span>(buf.remaining(), <span class="number">10</span>);</code></pre></div>
<h5 id="implementer-notes"><a href="#implementer-notes">Implementer notes</a></h5>
<p>Implementations of <code>remaining</code> should ensure that the return value does
not change unless a call is made to <code>advance</code> or any other function that
is documented to change the <code>Buf</code>s current position.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.chunk" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#133">source</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a></h4></section></summary><div class="docblock"><p>Returns a slice starting at the current position and of length between 0
and <code>Buf::remaining()</code>. Note that this <em>can</em> return shorter slice (this allows
non-continuous internal representation).</p>
<p>This is a lower level function. Most operations are done with other
functions.</p>
<h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..];
<span class="macro">assert_eq!</span>(buf.chunk(), <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..]);
buf.advance(<span class="number">6</span>);
<span class="macro">assert_eq!</span>(buf.chunk(), <span class="kw-2">&amp;</span><span class="string">b"world"</span>[..]);</code></pre></div>
<h5 id="implementer-notes-1"><a href="#implementer-notes-1">Implementer notes</a></h5>
<p>This function should never panic. Once the end of the buffer is reached,
i.e., <code>Buf::remaining</code> returns 0, calls to <code>chunk()</code> should return an
empty slice.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.advance" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#207">source</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Advance the internal cursor of the Buf</p>
<p>The next call to <code>chunk()</code> will return a slice starting <code>cnt</code> bytes
further into the underlying buffer.</p>
<h5 id="examples-2"><a href="#examples-2">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..];
<span class="macro">assert_eq!</span>(buf.chunk(), <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..]);
buf.advance(<span class="number">6</span>);
<span class="macro">assert_eq!</span>(buf.chunk(), <span class="kw-2">&amp;</span><span class="string">b"world"</span>[..]);</code></pre></div>
<h5 id="panics"><a href="#panics">Panics</a></h5>
<p>This function <strong>may</strong> panic if <code>cnt &gt; self.remaining()</code>.</p>
<h5 id="implementer-notes-2"><a href="#implementer-notes-2">Implementer notes</a></h5>
<p>It is recommended for implementations of <code>advance</code> to panic if <code>cnt &gt; self.remaining()</code>. If the implementation does not panic, the call must
behave as if <code>cnt == self.remaining()</code>.</p>
<p>A call with <code>cnt == 0</code> should never panic and be a no-op.</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.chunks_vectored" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#164-175">source</a><h4 class="code-header">fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a>&lt;'a&gt;(&amp;'a self, dst: &amp;mut [<a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'a&gt;]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Fills <code>dst</code> with potentially multiple slices starting at <code>self</code>s
current position.</p>
<p>If the <code>Buf</code> is backed by disjoint slices of bytes, <code>chunk_vectored</code> enables
fetching more than one slice at once. <code>dst</code> is a slice of <code>IoSlice</code>
references, enabling the slice to be directly used with <a href="http://man7.org/linux/man-pages/man2/readv.2.html"><code>writev</code></a>
without any further conversion. The sum of the lengths of all the
buffers in <code>dst</code> will be less than or equal to <code>Buf::remaining()</code>.</p>
<p>The entries in <code>dst</code> will be overwritten, but the data <strong>contained</strong> by
the slices <strong>will not</strong> be modified. If <code>chunk_vectored</code> does not fill every
entry in <code>dst</code>, then <code>dst</code> is guaranteed to contain all remaining slices
in `self.</p>
<p>This is a lower level function. Most operations are done with other
functions.</p>
<h5 id="implementer-notes-3"><a href="#implementer-notes-3">Implementer notes</a></h5>
<p>This function should never panic. Once the end of the buffer is reached,
i.e., <code>Buf::remaining</code> returns 0, calls to <code>chunk_vectored</code> must return 0
without mutating <code>dst</code>.</p>
<p>Implementations should also take care to properly handle being called
with <code>dst</code> being a zero length slice.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_remaining" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#226-228">source</a><h4 class="code-header">fn <a href="#method.has_remaining" class="fn">has_remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns true if there are any more bytes to consume</p>
<p>This is equivalent to <code>self.remaining() != 0</code>.</p>
<h5 id="examples-3"><a href="#examples-3">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"a"</span>[..];
<span class="macro">assert!</span>(buf.has_remaining());
buf.get_u8();
<span class="macro">assert!</span>(!buf.has_remaining());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.copy_to_slice" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#251-270">source</a><h4 class="code-header">fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&amp;mut self, dst: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>])</h4></section></summary><div class="docblock"><p>Copies bytes from <code>self</code> into <code>dst</code>.</p>
<p>The cursor is advanced by the number of bytes copied. <code>self</code> must have
enough remaining bytes to fill <code>dst</code>.</p>
<h5 id="examples-4"><a href="#examples-4">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..];
<span class="kw">let </span><span class="kw-2">mut </span>dst = [<span class="number">0</span>; <span class="number">5</span>];
buf.copy_to_slice(<span class="kw-2">&amp;mut </span>dst);
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span><span class="string">b"hello"</span>[..], <span class="kw-2">&amp;</span>dst);
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
<h5 id="panics-1"><a href="#panics-1">Panics</a></h5>
<p>This function panics if <code>self.remaining() &lt; dst.len()</code></p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u8" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#288-293">source</a><h4 class="code-header">fn <a href="#method.get_u8" class="fn">get_u8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 8 bit integer from <code>self</code>.</p>
<p>The current position is advanced by 1.</p>
<h5 id="examples-5"><a href="#examples-5">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">8</span>, buf.get_u8());</code></pre></div>
<h5 id="panics-2"><a href="#panics-2">Panics</a></h5>
<p>This function panics if there is no more remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i8" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#311-316">source</a><h4 class="code-header">fn <a href="#method.get_i8" class="fn">get_i8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i8.html">i8</a></h4></section></summary><div class="docblock"><p>Gets a signed 8 bit integer from <code>self</code>.</p>
<p>The current position is advanced by 1.</p>
<h5 id="examples-6"><a href="#examples-6">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">8</span>, buf.get_i8());</code></pre></div>
<h5 id="panics-3"><a href="#panics-3">Panics</a></h5>
<p>This function panics if there is no more remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u16" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#334-336">source</a><h4 class="code-header">fn <a href="#method.get_u16" class="fn">get_u16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 16 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 2.</p>
<h5 id="examples-7"><a href="#examples-7">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08\x09 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809</span>, buf.get_u16());</code></pre></div>
<h5 id="panics-4"><a href="#panics-4">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u16_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#354-356">source</a><h4 class="code-header">fn <a href="#method.get_u16_le" class="fn">get_u16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 16 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 2.</p>
<h5 id="examples-8"><a href="#examples-8">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x09\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809</span>, buf.get_u16_le());</code></pre></div>
<h5 id="panics-5"><a href="#panics-5">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u16_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#377-379">source</a><h4 class="code-header">fn <a href="#method.get_u16_ne" class="fn">get_u16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 16 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 2.</p>
<h5 id="examples-9"><a href="#examples-9">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x08\x09 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x09\x08 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x0809</span>, buf.get_u16_ne());</code></pre></div>
<h5 id="panics-6"><a href="#panics-6">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i16" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#397-399">source</a><h4 class="code-header">fn <a href="#method.get_i16" class="fn">get_i16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Gets a signed 16 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 2.</p>
<h5 id="examples-10"><a href="#examples-10">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08\x09 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809</span>, buf.get_i16());</code></pre></div>
<h5 id="panics-7"><a href="#panics-7">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i16_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#417-419">source</a><h4 class="code-header">fn <a href="#method.get_i16_le" class="fn">get_i16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Gets a signed 16 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 2.</p>
<h5 id="examples-11"><a href="#examples-11">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x09\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809</span>, buf.get_i16_le());</code></pre></div>
<h5 id="panics-8"><a href="#panics-8">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i16_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#440-442">source</a><h4 class="code-header">fn <a href="#method.get_i16_ne" class="fn">get_i16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Gets a signed 16 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 2.</p>
<h5 id="examples-12"><a href="#examples-12">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x08\x09 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x09\x08 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x0809</span>, buf.get_i16_ne());</code></pre></div>
<h5 id="panics-9"><a href="#panics-9">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u32" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#460-462">source</a><h4 class="code-header">fn <a href="#method.get_u32" class="fn">get_u32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 32 bit integer from <code>self</code> in the big-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-13"><a href="#examples-13">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08\x09\xA0\xA1 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809A0A1</span>, buf.get_u32());</code></pre></div>
<h5 id="panics-10"><a href="#panics-10">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u32_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#480-482">source</a><h4 class="code-header">fn <a href="#method.get_u32_le" class="fn">get_u32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 32 bit integer from <code>self</code> in the little-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-14"><a href="#examples-14">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\xA1\xA0\x09\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809A0A1</span>, buf.get_u32_le());</code></pre></div>
<h5 id="panics-11"><a href="#panics-11">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u32_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#503-505">source</a><h4 class="code-header">fn <a href="#method.get_u32_ne" class="fn">get_u32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 32 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-15"><a href="#examples-15">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x08\x09\xA0\xA1 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\xA1\xA0\x09\x08 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x0809A0A1</span>, buf.get_u32_ne());</code></pre></div>
<h5 id="panics-12"><a href="#panics-12">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i32" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#523-525">source</a><h4 class="code-header">fn <a href="#method.get_i32" class="fn">get_i32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Gets a signed 32 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-16"><a href="#examples-16">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08\x09\xA0\xA1 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809A0A1</span>, buf.get_i32());</code></pre></div>
<h5 id="panics-13"><a href="#panics-13">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i32_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#543-545">source</a><h4 class="code-header">fn <a href="#method.get_i32_le" class="fn">get_i32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Gets a signed 32 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-17"><a href="#examples-17">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\xA1\xA0\x09\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0809A0A1</span>, buf.get_i32_le());</code></pre></div>
<h5 id="panics-14"><a href="#panics-14">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i32_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#566-568">source</a><h4 class="code-header">fn <a href="#method.get_i32_ne" class="fn">get_i32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Gets a signed 32 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-18"><a href="#examples-18">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x08\x09\xA0\xA1 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\xA1\xA0\x09\x08 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x0809A0A1</span>, buf.get_i32_ne());</code></pre></div>
<h5 id="panics-15"><a href="#panics-15">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u64" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#586-588">source</a><h4 class="code-header">fn <a href="#method.get_u64" class="fn">get_u64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 64 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-19"><a href="#examples-19">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0102030405060708</span>, buf.get_u64());</code></pre></div>
<h5 id="panics-16"><a href="#panics-16">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u64_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#606-608">source</a><h4 class="code-header">fn <a href="#method.get_u64_le" class="fn">get_u64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 64 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-20"><a href="#examples-20">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0102030405060708</span>, buf.get_u64_le());</code></pre></div>
<h5 id="panics-17"><a href="#panics-17">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u64_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#629-631">source</a><h4 class="code-header">fn <a href="#method.get_u64_ne" class="fn">get_u64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 64 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-21"><a href="#examples-21">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x0102030405060708</span>, buf.get_u64_ne());</code></pre></div>
<h5 id="panics-18"><a href="#panics-18">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i64" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#649-651">source</a><h4 class="code-header">fn <a href="#method.get_i64" class="fn">get_i64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Gets a signed 64 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-22"><a href="#examples-22">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0102030405060708</span>, buf.get_i64());</code></pre></div>
<h5 id="panics-19"><a href="#panics-19">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i64_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#669-671">source</a><h4 class="code-header">fn <a href="#method.get_i64_le" class="fn">get_i64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Gets a signed 64 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-23"><a href="#examples-23">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x0102030405060708</span>, buf.get_i64_le());</code></pre></div>
<h5 id="panics-20"><a href="#panics-20">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i64_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#692-694">source</a><h4 class="code-header">fn <a href="#method.get_i64_ne" class="fn">get_i64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Gets a signed 64 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-24"><a href="#examples-24">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x0102030405060708</span>, buf.get_i64_ne());</code></pre></div>
<h5 id="panics-21"><a href="#panics-21">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u128" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#712-714">source</a><h4 class="code-header">fn <a href="#method.get_u128" class="fn">get_u128</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u128.html">u128</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 128 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 16.</p>
<h5 id="examples-25"><a href="#examples-25">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x01020304050607080910111213141516</span>, buf.get_u128());</code></pre></div>
<h5 id="panics-22"><a href="#panics-22">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u128_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#732-734">source</a><h4 class="code-header">fn <a href="#method.get_u128_le" class="fn">get_u128_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u128.html">u128</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 128 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 16.</p>
<h5 id="examples-26"><a href="#examples-26">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x01020304050607080910111213141516</span>, buf.get_u128_le());</code></pre></div>
<h5 id="panics-23"><a href="#panics-23">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_u128_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#755-757">source</a><h4 class="code-header">fn <a href="#method.get_u128_ne" class="fn">get_u128_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u128.html">u128</a></h4></section></summary><div class="docblock"><p>Gets an unsigned 128 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 16.</p>
<h5 id="examples-27"><a href="#examples-27">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x01020304050607080910111213141516</span>, buf.get_u128_ne());</code></pre></div>
<h5 id="panics-24"><a href="#panics-24">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i128" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#775-777">source</a><h4 class="code-header">fn <a href="#method.get_i128" class="fn">get_i128</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i128.html">i128</a></h4></section></summary><div class="docblock"><p>Gets a signed 128 bit integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 16.</p>
<h5 id="examples-28"><a href="#examples-28">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x01020304050607080910111213141516</span>, buf.get_i128());</code></pre></div>
<h5 id="panics-25"><a href="#panics-25">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i128_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#795-797">source</a><h4 class="code-header">fn <a href="#method.get_i128_le" class="fn">get_i128_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i128.html">i128</a></h4></section></summary><div class="docblock"><p>Gets a signed 128 bit integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 16.</p>
<h5 id="examples-29"><a href="#examples-29">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x01020304050607080910111213141516</span>, buf.get_i128_le());</code></pre></div>
<h5 id="panics-26"><a href="#panics-26">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_i128_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#818-820">source</a><h4 class="code-header">fn <a href="#method.get_i128_ne" class="fn">get_i128_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i128.html">i128</a></h4></section></summary><div class="docblock"><p>Gets a signed 128 bit integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 16.</p>
<h5 id="examples-30"><a href="#examples-30">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x01020304050607080910111213141516</span>, buf.get_i128_ne());</code></pre></div>
<h5 id="panics-27"><a href="#panics-27">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_uint" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#838-840">source</a><h4 class="code-header">fn <a href="#method.get_uint" class="fn">get_uint</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gets an unsigned n-byte integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by <code>nbytes</code>.</p>
<h5 id="examples-31"><a href="#examples-31">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x01\x02\x03 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x010203</span>, buf.get_uint(<span class="number">3</span>));</code></pre></div>
<h5 id="panics-28"><a href="#panics-28">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_uint_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#858-860">source</a><h4 class="code-header">fn <a href="#method.get_uint_le" class="fn">get_uint_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gets an unsigned n-byte integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by <code>nbytes</code>.</p>
<h5 id="examples-32"><a href="#examples-32">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x03\x02\x01 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x010203</span>, buf.get_uint_le(<span class="number">3</span>));</code></pre></div>
<h5 id="panics-29"><a href="#panics-29">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_uint_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#881-887">source</a><h4 class="code-header">fn <a href="#method.get_uint_ne" class="fn">get_uint_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Gets an unsigned n-byte integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by <code>nbytes</code>.</p>
<h5 id="examples-33"><a href="#examples-33">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x01\x02\x03 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x03\x02\x01 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x010203</span>, buf.get_uint_ne(<span class="number">3</span>));</code></pre></div>
<h5 id="panics-30"><a href="#panics-30">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_int" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#905-907">source</a><h4 class="code-header">fn <a href="#method.get_int" class="fn">get_int</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Gets a signed n-byte integer from <code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by <code>nbytes</code>.</p>
<h5 id="examples-34"><a href="#examples-34">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x01\x02\x03 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x010203</span>, buf.get_int(<span class="number">3</span>));</code></pre></div>
<h5 id="panics-31"><a href="#panics-31">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_int_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#925-927">source</a><h4 class="code-header">fn <a href="#method.get_int_le" class="fn">get_int_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Gets a signed n-byte integer from <code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by <code>nbytes</code>.</p>
<h5 id="examples-35"><a href="#examples-35">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x03\x02\x01 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">0x010203</span>, buf.get_int_le(<span class="number">3</span>));</code></pre></div>
<h5 id="panics-32"><a href="#panics-32">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_int_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#948-954">source</a><h4 class="code-header">fn <a href="#method.get_int_ne" class="fn">get_int_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section></summary><div class="docblock"><p>Gets a signed n-byte integer from <code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by <code>nbytes</code>.</p>
<h5 id="examples-36"><a href="#examples-36">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x01\x02\x03 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x03\x02\x01 hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">0x010203</span>, buf.get_int_ne(<span class="number">3</span>));</code></pre></div>
<h5 id="panics-33"><a href="#panics-33">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_f32" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#973-975">source</a><h4 class="code-header">fn <a href="#method.get_f32" class="fn">get_f32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Gets an IEEE754 single-precision (4 bytes) floating point number from
<code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-37"><a href="#examples-37">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x3F\x99\x99\x9A hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">1.2f32</span>, buf.get_f32());</code></pre></div>
<h5 id="panics-34"><a href="#panics-34">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_f32_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#994-996">source</a><h4 class="code-header">fn <a href="#method.get_f32_le" class="fn">get_f32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Gets an IEEE754 single-precision (4 bytes) floating point number from
<code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-38"><a href="#examples-38">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x9A\x99\x99\x3F hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">1.2f32</span>, buf.get_f32_le());</code></pre></div>
<h5 id="panics-35"><a href="#panics-35">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_f32_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1018-1020">source</a><h4 class="code-header">fn <a href="#method.get_f32_ne" class="fn">get_f32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Gets an IEEE754 single-precision (4 bytes) floating point number from
<code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 4.</p>
<h5 id="examples-39"><a href="#examples-39">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x3F\x99\x99\x9A hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x9A\x99\x99\x3F hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">1.2f32</span>, buf.get_f32_ne());</code></pre></div>
<h5 id="panics-36"><a href="#panics-36">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_f64" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1039-1041">source</a><h4 class="code-header">fn <a href="#method.get_f64" class="fn">get_f64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f64.html">f64</a></h4></section></summary><div class="docblock"><p>Gets an IEEE754 double-precision (8 bytes) floating point number from
<code>self</code> in big-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-40"><a href="#examples-40">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33\x33 hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">1.2f64</span>, buf.get_f64());</code></pre></div>
<h5 id="panics-37"><a href="#panics-37">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_f64_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1060-1062">source</a><h4 class="code-header">fn <a href="#method.get_f64_le" class="fn">get_f64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f64.html">f64</a></h4></section></summary><div class="docblock"><p>Gets an IEEE754 double-precision (8 bytes) floating point number from
<code>self</code> in little-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-41"><a href="#examples-41">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&amp;</span><span class="string">b"\x33\x33\x33\x33\x33\x33\xF3\x3F hello"</span>[..];
<span class="macro">assert_eq!</span>(<span class="number">1.2f64</span>, buf.get_f64_le());</code></pre></div>
<h5 id="panics-38"><a href="#panics-38">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_f64_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1084-1086">source</a><h4 class="code-header">fn <a href="#method.get_f64_ne" class="fn">get_f64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.f64.html">f64</a></h4></section></summary><div class="docblock"><p>Gets an IEEE754 double-precision (8 bytes) floating point number from
<code>self</code> in native-endian byte order.</p>
<p>The current position is advanced by 8.</p>
<h5 id="examples-42"><a href="#examples-42">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&amp;</span>[u8] = <span class="kw">match </span><span class="macro">cfg!</span>(target_endian = <span class="string">"big"</span>) {
<span class="bool-val">true </span>=&gt; <span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33\x33 hello"</span>,
<span class="bool-val">false </span>=&gt; <span class="string">b"\x33\x33\x33\x33\x33\x33\xF3\x3F hello"</span>,
};
<span class="macro">assert_eq!</span>(<span class="number">1.2f64</span>, buf.get_f64_ne());</code></pre></div>
<h5 id="panics-39"><a href="#panics-39">Panics</a></h5>
<p>This function panics if there is not enough remaining data in <code>self</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.copy_to_bytes" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1103-1111">source</a><h4 class="code-header">fn <a href="#method.copy_to_bytes" class="fn">copy_to_bytes</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../struct.Bytes.html" title="struct bytes::Bytes">Bytes</a></h4></section></summary><div class="docblock"><p>Consumes <code>len</code> bytes inside self and returns new instance of <code>Bytes</code>
with this data.</p>
<p>This function may be optimized by the underlying type to avoid actual
copies. For example, <code>Bytes</code> implementation will do a shallow copy
(ref-count increment).</p>
<h5 id="examples-43"><a href="#examples-43">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span>bytes = (<span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..]).copy_to_bytes(<span class="number">5</span>);
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>bytes[..], <span class="kw-2">&amp;</span><span class="string">b"hello"</span>[..]);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.take" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1134-1139">source</a><h4 class="code-header">fn <a href="#method.take" class="fn">take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="struct.Take.html" title="struct bytes::buf::Take">Take</a>&lt;Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Creates an adaptor which will read at most <code>limit</code> bytes from <code>self</code>.</p>
<p>This function returns a new instance of <code>Buf</code> which will read at most
<code>limit</code> bytes.</p>
<h5 id="examples-44"><a href="#examples-44">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, BufMut};
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="string">b"hello world"</span>[..].take(<span class="number">5</span>);
<span class="kw">let </span><span class="kw-2">mut </span>dst = <span class="macro">vec!</span>[];
dst.put(<span class="kw-2">&amp;mut </span>buf);
<span class="macro">assert_eq!</span>(dst, <span class="string">b"hello"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>buf = buf.into_inner();
dst.clear();
dst.put(<span class="kw-2">&amp;mut </span>buf);
<span class="macro">assert_eq!</span>(dst, <span class="string">b" world"</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.chain" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1156-1161">source</a><h4 class="code-header">fn <a href="#method.chain" class="fn">chain</a>&lt;U: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>&gt;(self, next: U) -&gt; <a class="struct" href="struct.Chain.html" title="struct bytes::buf::Chain">Chain</a>&lt;Self, U&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Creates an adaptor which will chain this buffer with another.</p>
<p>The returned <code>Buf</code> instance will first consume all bytes from <code>self</code>.
Afterwards the output is equivalent to the output of next.</p>
<h5 id="examples-45"><a href="#examples-45">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
<span class="kw">let </span><span class="kw-2">mut </span>chain = <span class="string">b"hello "</span>[..].chain(<span class="kw-2">&amp;</span><span class="string">b"world"</span>[..]);
<span class="kw">let </span>full = chain.copy_to_bytes(<span class="number">11</span>);
<span class="macro">assert_eq!</span>(full.chunk(), <span class="string">b"hello world"</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.reader" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1188-1193">source</a><h4 class="code-header">fn <a href="#method.reader" class="fn">reader</a>(self) -&gt; <a class="struct" href="struct.Reader.html" title="struct bytes::buf::Reader">Reader</a>&lt;Self&gt; <a href="#" class="tooltip" data-notable-ty="Reader&lt;Self&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Creates an adaptor which implements the <code>Read</code> trait for <code>self</code>.</p>
<p>This function returns a new value which implements <code>Read</code> by adapting
the <code>Read</code> trait functions to the <code>Buf</code> trait functions. Given that
<code>Buf</code> operations are infallible, none of the <code>Read</code> functions will
return with <code>Err</code>.</p>
<h5 id="examples-46"><a href="#examples-46">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Bytes, Buf};
<span class="kw">use </span>std::io::Read;
<span class="kw">let </span>buf = Bytes::from(<span class="string">"hello world"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>reader = buf.reader();
<span class="kw">let </span><span class="kw-2">mut </span>dst = [<span class="number">0</span>; <span class="number">1024</span>];
<span class="kw">let </span>num = reader.read(<span class="kw-2">&amp;mut </span>dst).unwrap();
<span class="macro">assert_eq!</span>(<span class="number">11</span>, num);
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>dst[..<span class="number">11</span>], <span class="kw-2">&amp;</span><span class="string">b"hello world"</span>[..]);</code></pre></div>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Buf-for-%26%5Bu8%5D" class="impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1341-1356">source</a><a href="#impl-Buf-for-%26%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>]</h3></section></summary><div class="impl-items"><section id="method.remaining" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1343-1345">source</a><a href="#method.remaining" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.chunk" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1348-1350">source</a><a href="#method.chunk" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a></h4></section><section id="method.advance" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1353-1355">source</a><a href="#method.advance" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Buf-for-VecDeque%3Cu8%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/vec_deque.rs.html#5-22">source</a><a href="#impl-Buf-for-VecDeque%3Cu8%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/collections/vec_deque/struct.VecDeque.html" title="struct alloc::collections::vec_deque::VecDeque">VecDeque</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>&gt;</h3></section></summary><div class="impl-items"><section id="method.remaining-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/vec_deque.rs.html#6-8">source</a><a href="#method.remaining-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.chunk-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/vec_deque.rs.html#10-17">source</a><a href="#method.chunk-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a></h4></section><section id="method.advance-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/vec_deque.rs.html#19-21">source</a><a href="#method.advance-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Buf-for-Cursor%3CT%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1359-1390">source</a><a href="#impl-Buf-for-Cursor%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>]&gt;&gt; <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.remaining-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1360-1369">source</a><a href="#method.remaining-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.chunk-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1371-1380">source</a><a href="#method.chunk-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a></h4></section><section id="method.advance-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1382-1389">source</a><a href="#method.advance-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Buf-for-%26mut+T" class="impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1333-1335">source</a><a href="#impl-Buf-for-%26mut+T" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&amp;mut T</a></h3></section></summary><div class="impl-items"><section id="method.remaining-3" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.remaining-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.chunk-3" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.chunk-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a></h4></section><section id="method.chunks_vectored-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.chunks_vectored-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a>&lt;'b&gt;(&amp;'b self, dst: &amp;mut [<a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'b&gt;]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.advance-3" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.advance-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>)</h4></section><section id="method.has_remaining-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.has_remaining-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.has_remaining" class="fn">has_remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section><section id="method.copy_to_slice-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.copy_to_slice-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&amp;mut self, dst: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>])</h4></section><section id="method.get_u8-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u8-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u8" class="fn">get_u8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a></h4></section><section id="method.get_i8-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i8-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i8" class="fn">get_i8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i8.html">i8</a></h4></section><section id="method.get_u16-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u16-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u16" class="fn">get_u16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section><section id="method.get_u16_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u16_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u16_le" class="fn">get_u16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section><section id="method.get_u16_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u16_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u16_ne" class="fn">get_u16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section><section id="method.get_i16-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i16-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i16" class="fn">get_i16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section><section id="method.get_i16_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i16_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i16_le" class="fn">get_i16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section><section id="method.get_i16_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i16_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i16_ne" class="fn">get_i16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section><section id="method.get_u32-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u32" class="fn">get_u32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section><section id="method.get_u32_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u32_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u32_le" class="fn">get_u32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section><section id="method.get_u32_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u32_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u32_ne" class="fn">get_u32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section><section id="method.get_i32-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i32" class="fn">get_i32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section><section id="method.get_i32_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i32_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i32_le" class="fn">get_i32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section><section id="method.get_i32_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i32_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i32_ne" class="fn">get_i32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section><section id="method.get_u64-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u64" class="fn">get_u64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_u64_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u64_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u64_le" class="fn">get_u64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_u64_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_u64_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u64_ne" class="fn">get_u64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_i64-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i64" class="fn">get_i64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_i64_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i64_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i64_le" class="fn">get_i64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_i64_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_i64_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i64_ne" class="fn">get_i64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_uint-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_uint-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_uint" class="fn">get_uint</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_uint_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_uint_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_uint_le" class="fn">get_uint_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_uint_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_uint_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_uint_ne" class="fn">get_uint_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_int-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_int-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_int" class="fn">get_int</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_int_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_int_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_int_le" class="fn">get_int_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_int_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.get_int_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_int_ne" class="fn">get_int_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.copy_to_bytes-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">source</a><a href="#method.copy_to_bytes-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.copy_to_bytes" class="fn">copy_to_bytes</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../struct.Bytes.html" title="struct bytes::Bytes">Bytes</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Buf-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1337-1339">source</a><a href="#impl-Buf-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.remaining-4" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.remaining-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.chunk-4" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.chunk-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]"></a></h4></section><section id="method.chunks_vectored-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.chunks_vectored-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a>&lt;'b&gt;(&amp;'b self, dst: &amp;mut [<a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'b&gt;]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><section id="method.advance-4" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.advance-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&amp;mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>)</h4></section><section id="method.has_remaining-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.has_remaining-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.has_remaining" class="fn">has_remaining</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section><section id="method.copy_to_slice-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.copy_to_slice-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&amp;mut self, dst: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>])</h4></section><section id="method.get_u8-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u8-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u8" class="fn">get_u8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a></h4></section><section id="method.get_i8-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i8-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i8" class="fn">get_i8</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i8.html">i8</a></h4></section><section id="method.get_u16-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u16-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u16" class="fn">get_u16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section><section id="method.get_u16_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u16_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u16_le" class="fn">get_u16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section><section id="method.get_u16_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u16_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u16_ne" class="fn">get_u16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u16.html">u16</a></h4></section><section id="method.get_i16-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i16-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i16" class="fn">get_i16</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section><section id="method.get_i16_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i16_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i16_le" class="fn">get_i16_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section><section id="method.get_i16_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i16_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i16_ne" class="fn">get_i16_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i16.html">i16</a></h4></section><section id="method.get_u32-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u32" class="fn">get_u32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section><section id="method.get_u32_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u32_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u32_le" class="fn">get_u32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section><section id="method.get_u32_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u32_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u32_ne" class="fn">get_u32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a></h4></section><section id="method.get_i32-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i32" class="fn">get_i32</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section><section id="method.get_i32_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i32_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i32_le" class="fn">get_i32_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section><section id="method.get_i32_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i32_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i32_ne" class="fn">get_i32_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i32.html">i32</a></h4></section><section id="method.get_u64-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u64" class="fn">get_u64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_u64_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u64_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u64_le" class="fn">get_u64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_u64_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_u64_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u64_ne" class="fn">get_u64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_i64-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i64" class="fn">get_i64</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_i64_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i64_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i64_le" class="fn">get_i64_le</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_i64_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_i64_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i64_ne" class="fn">get_i64_ne</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_uint-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_uint-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_uint" class="fn">get_uint</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_uint_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_uint_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_uint_le" class="fn">get_uint_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_uint_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_uint_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_uint_ne" class="fn">get_uint_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u64.html">u64</a></h4></section><section id="method.get_int-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_int-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_int" class="fn">get_int</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_int_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_int_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_int_le" class="fn">get_int_le</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.get_int_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.get_int_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_int_ne" class="fn">get_int_ne</a>(&amp;mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.i64.html">i64</a></h4></section><section id="method.copy_to_bytes-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1338">source</a><a href="#method.copy_to_bytes-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.copy_to_bytes" class="fn">copy_to_bytes</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../struct.Bytes.html" title="struct bytes::Bytes">Bytes</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Buf-for-Bytes" class="impl"><a class="src rightside" href="../../src/bytes/bytes.rs.html#536-570">source</a><a href="#impl-Buf-for-Bytes" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="../struct.Bytes.html" title="struct bytes::Bytes">Bytes</a></h3></section><section id="impl-Buf-for-BytesMut" class="impl"><a class="src rightside" href="../../src/bytes/bytes_mut.rs.html#1053-1080">source</a><a href="#impl-Buf-for-BytesMut" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="../struct.BytesMut.html" title="struct bytes::BytesMut">BytesMut</a></h3></section><section id="impl-Buf-for-Chain%3CT,+U%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/chain.rs.html#132-191">source</a><a href="#impl-Buf-for-Chain%3CT,+U%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="struct.Chain.html" title="struct bytes::buf::Chain">Chain</a>&lt;T, U&gt;<div class="where">where
T: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>,
U: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>,</div></h3></section><section id="impl-Buf-for-Take%3CT%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/take.rs.html#132-155">source</a><a href="#impl-Buf-for-Take%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>&gt; <a class="trait" href="trait.Buf.html" title="trait bytes::buf::Buf">Buf</a> for <a class="struct" href="struct.Take.html" title="struct bytes::buf::Take">Take</a>&lt;T&gt;</h3></section></div><script src="../../trait.impl/bytes/buf/buf_impl/trait.Buf.js" data-ignore-extern-crates="alloc,std" async></script><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</div>","Reader<Self>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Reader.html\" title=\"struct bytes::buf::Reader\">Reader</a>&lt;B&gt;</code></h3><pre><code><div class=\"where\">impl&lt;B: <a class=\"trait\" href=\"trait.Buf.html\" title=\"trait bytes::buf::Buf\">Buf</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for <a class=\"struct\" href=\"struct.Reader.html\" title=\"struct bytes::buf::Reader\">Reader</a>&lt;B&gt;</div>"}</script></section></div></main></body></html>