1237 lines
296 KiB
HTML
1237 lines
296 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Read bytes from a buffer."><title>Buf in hyper::body - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="hyper" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Buf</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../hyper/index.html">hyper</a><span class="version">1.8.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Buf</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.advance" title="advance">advance</a></li><li><a href="#tymethod.chunk" title="chunk">chunk</a></li><li><a href="#tymethod.remaining" title="remaining">remaining</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.chain" title="chain">chain</a></li><li><a href="#method.chunks_vectored" title="chunks_vectored">chunks_vectored</a></li><li><a href="#method.copy_to_bytes" title="copy_to_bytes">copy_to_bytes</a></li><li><a href="#method.copy_to_slice" title="copy_to_slice">copy_to_slice</a></li><li><a href="#method.get_f32" title="get_f32">get_f32</a></li><li><a href="#method.get_f64" title="get_f64">get_f64</a></li><li><a href="#method.get_f32_le" title="get_f32_le">get_f32_le</a></li><li><a href="#method.get_f32_ne" title="get_f32_ne">get_f32_ne</a></li><li><a href="#method.get_f64_le" title="get_f64_le">get_f64_le</a></li><li><a href="#method.get_f64_ne" title="get_f64_ne">get_f64_ne</a></li><li><a href="#method.get_i8" title="get_i8">get_i8</a></li><li><a href="#method.get_i16" title="get_i16">get_i16</a></li><li><a href="#method.get_i32" title="get_i32">get_i32</a></li><li><a href="#method.get_i64" title="get_i64">get_i64</a></li><li><a href="#method.get_i16_le" title="get_i16_le">get_i16_le</a></li><li><a href="#method.get_i16_ne" title="get_i16_ne">get_i16_ne</a></li><li><a href="#method.get_i32_le" title="get_i32_le">get_i32_le</a></li><li><a href="#method.get_i32_ne" title="get_i32_ne">get_i32_ne</a></li><li><a href="#method.get_i64_le" title="get_i64_le">get_i64_le</a></li><li><a href="#method.get_i64_ne" title="get_i64_ne">get_i64_ne</a></li><li><a href="#method.get_i128" title="get_i128">get_i128</a></li><li><a href="#method.get_i128_le" title="get_i128_le">get_i128_le</a></li><li><a href="#method.get_i128_ne" title="get_i128_ne">get_i128_ne</a></li><li><a href="#method.get_int" title="get_int">get_int</a></li><li><a href="#method.get_int_le" title="get_int_le">get_int_le</a></li><li><a href="#method.get_int_ne" title="get_int_ne">get_int_ne</a></li><li><a href="#method.get_u8" title="get_u8">get_u8</a></li><li><a href="#method.get_u16" title="get_u16">get_u16</a></li><li><a href="#method.get_u32" title="get_u32">get_u32</a></li><li><a href="#method.get_u64" title="get_u64">get_u64</a></li><li><a href="#method.get_u16_le" title="get_u16_le">get_u16_le</a></li><li><a href="#method.get_u16_ne" title="get_u16_ne">get_u16_ne</a></li><li><a href="#method.get_u32_le" title="get_u32_le">get_u32_le</a></li><li><a href="#method.get_u32_ne" title="get_u32_ne">get_u32_ne</a></li><li><a href="#method.get_u64_le" title="get_u64_le">get_u64_le</a></li><li><a href="#method.get_u64_ne" title="get_u64_ne">get_u64_ne</a></li><li><a href="#method.get_u128" title="get_u128">get_u128</a></li><li><a href="#method.get_u128_le" title="get_u128_le">get_u128_le</a></li><li><a href="#method.get_u128_ne" title="get_u128_ne">get_u128_ne</a></li><li><a href="#method.get_uint" title="get_uint">get_uint</a></li><li><a href="#method.get_uint_le" title="get_uint_le">get_uint_le</a></li><li><a href="#method.get_uint_ne" title="get_uint_ne">get_uint_ne</a></li><li><a href="#method.has_remaining" title="has_remaining">has_remaining</a></li><li><a href="#method.reader" title="reader">reader</a></li><li><a href="#method.take" title="take">take</a></li><li><a href="#method.try_copy_to_slice" title="try_copy_to_slice">try_copy_to_slice</a></li><li><a href="#method.try_get_f32" title="try_get_f32">try_get_f32</a></li><li><a href="#method.try_get_f64" title="try_get_f64">try_get_f64</a></li><li><a href="#method.try_get_f32_le" title="try_get_f32_le">try_get_f32_le</a></li><li><a href="#method.try_get_f32_ne" title="try_get_f32_ne">try_get_f32_ne</a></li><li><a href="#method.try_get_f64_le" title="try_get_f64_le">try_get_f64_le</a></li><li><a href="#method.try_get_f64_ne" title="try_get_f64_ne">try_get_f64_ne</a></li><li><a href="#method.try_get_i8" title="try_get_i8">try_get_i8</a></li><li><a href="#method.try_get_i16" title="try_get_i16">try_get_i16</a></li><li><a href="#method.try_get_i32" title="try_get_i32">try_get_i32</a></li><li><a href="#method.try_get_i64" title="try_get_i64">try_get_i64</a></li><li><a href="#method.try_get_i16_le" title="try_get_i16_le">try_get_i16_le</a></li><li><a href="#method.try_get_i16_ne" title="try_get_i16_ne">try_get_i16_ne</a></li><li><a href="#method.try_get_i32_le" title="try_get_i32_le">try_get_i32_le</a></li><li><a href="#method.try_get_i32_ne" title="try_get_i32_ne">try_get_i32_ne</a></li><li><a href="#method.try_get_i64_le" title="try_get_i64_le">try_get_i64_le</a></li><li><a href="#method.try_get_i64_ne" title="try_get_i64_ne">try_get_i64_ne</a></li><li><a href="#method.try_get_i128" title="try_get_i128">try_get_i128</a></li><li><a href="#method.try_get_i128_le" title="try_get_i128_le">try_get_i128_le</a></li><li><a href="#method.try_get_i128_ne" title="try_get_i128_ne">try_get_i128_ne</a></li><li><a href="#method.try_get_int" title="try_get_int">try_get_int</a></li><li><a href="#method.try_get_int_le" title="try_get_int_le">try_get_int_le</a></li><li><a href="#method.try_get_int_ne" title="try_get_int_ne">try_get_int_ne</a></li><li><a href="#method.try_get_u8" title="try_get_u8">try_get_u8</a></li><li><a href="#method.try_get_u16" title="try_get_u16">try_get_u16</a></li><li><a href="#method.try_get_u32" title="try_get_u32">try_get_u32</a></li><li><a href="#method.try_get_u64" title="try_get_u64">try_get_u64</a></li><li><a href="#method.try_get_u16_le" title="try_get_u16_le">try_get_u16_le</a></li><li><a href="#method.try_get_u16_ne" title="try_get_u16_ne">try_get_u16_ne</a></li><li><a href="#method.try_get_u32_le" title="try_get_u32_le">try_get_u32_le</a></li><li><a href="#method.try_get_u32_ne" title="try_get_u32_ne">try_get_u32_ne</a></li><li><a href="#method.try_get_u64_le" title="try_get_u64_le">try_get_u64_le</a></li><li><a href="#method.try_get_u64_ne" title="try_get_u64_ne">try_get_u64_ne</a></li><li><a href="#method.try_get_u128" title="try_get_u128">try_get_u128</a></li><li><a href="#method.try_get_u128_le" title="try_get_u128_le">try_get_u128_le</a></li><li><a href="#method.try_get_u128_ne" title="try_get_u128_ne">try_get_u128_ne</a></li><li><a href="#method.try_get_uint" title="try_get_uint">try_get_uint</a></li><li><a href="#method.try_get_uint_le" title="try_get_uint_le">try_get_uint_le</a></li><li><a href="#method.try_get_uint_ne" title="try_get_uint_ne">try_get_uint_ne</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" title="&[u8]">&[u8]</a></li><li><a href="#impl-Buf-for-%26mut+T" title="&mut T">&mut T</a></li><li><a href="#impl-Buf-for-Box%3CT%3E" title="Box<T>">Box<T></a></li><li><a href="#impl-Buf-for-Cursor%3CT%3E" title="Cursor<T>">Cursor<T></a></li><li><a href="#impl-Buf-for-VecDeque%3Cu8%3E" title="VecDeque<u8>">VecDeque<u8></a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In hyper::<wbr>body</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">hyper</a>::<wbr><a href="index.html">body</a></div><h1>Trait <span class="trait">Buf</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/bytes/buf/buf_impl.rs.html#117">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Buf {
|
||
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 87 methods</span></summary> // Required methods
|
||
fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>);
|
||
|
||
// Provided methods
|
||
fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a><'a>(&'a self, dst: &mut [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'a>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.has_remaining" class="fn">has_remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u8" class="fn">get_u8</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i8" class="fn">get_i8</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u16" class="fn">get_u16</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u16_le" class="fn">get_u16_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u16_ne" class="fn">get_u16_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i16" class="fn">get_i16</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i16_le" class="fn">get_i16_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i16_ne" class="fn">get_i16_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u32" class="fn">get_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u32_le" class="fn">get_u32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u32_ne" class="fn">get_u32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i32" class="fn">get_i32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i32_le" class="fn">get_i32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i32_ne" class="fn">get_i32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u64" class="fn">get_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u64_le" class="fn">get_u64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u64_ne" class="fn">get_u64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i64" class="fn">get_i64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i64_le" class="fn">get_i64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i64_ne" class="fn">get_i64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u128" class="fn">get_u128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u128_le" class="fn">get_u128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_u128_ne" class="fn">get_u128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i128" class="fn">get_i128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i128_le" class="fn">get_i128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_i128_ne" class="fn">get_i128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_uint" class="fn">get_uint</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_uint_le" class="fn">get_uint_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_uint_ne" class="fn">get_uint_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_int" class="fn">get_int</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_int_le" class="fn">get_int_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_int_ne" class="fn">get_int_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_f32" class="fn">get_f32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_f32_le" class="fn">get_f32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_f32_ne" class="fn">get_f32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_f64" class="fn">get_f64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_f64_le" class="fn">get_f64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.get_f64_ne" class="fn">get_f64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_copy_to_slice" class="fn">try_copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u8" class="fn">try_get_u8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i8" class="fn">try_get_i8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u16" class="fn">try_get_u16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u16_le" class="fn">try_get_u16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u16_ne" class="fn">try_get_u16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i16" class="fn">try_get_i16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i16_le" class="fn">try_get_i16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i16_ne" class="fn">try_get_i16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u32" class="fn">try_get_u32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u32_le" class="fn">try_get_u32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u32_ne" class="fn">try_get_u32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i32" class="fn">try_get_i32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i32_le" class="fn">try_get_i32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i32_ne" class="fn">try_get_i32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u64" class="fn">try_get_u64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u64_le" class="fn">try_get_u64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u64_ne" class="fn">try_get_u64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i64" class="fn">try_get_i64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i64_le" class="fn">try_get_i64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i64_ne" class="fn">try_get_i64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u128" class="fn">try_get_u128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u128_le" class="fn">try_get_u128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_u128_ne" class="fn">try_get_u128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i128" class="fn">try_get_i128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i128_le" class="fn">try_get_i128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_i128_ne" class="fn">try_get_i128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_uint" class="fn">try_get_uint</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_uint_le" class="fn">try_get_uint_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_uint_ne" class="fn">try_get_uint_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_int" class="fn">try_get_int</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_int_le" class="fn">try_get_int_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_int_ne" class="fn">try_get_int_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_f32" class="fn">try_get_f32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_f32_le" class="fn">try_get_f32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_f32_ne" class="fn">try_get_f32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_f64" class="fn">try_get_f64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_f64_le" class="fn">try_get_f64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.try_get_f64_ne" class="fn">try_get_f64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.copy_to_bytes" class="fn">copy_to_bytes</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.Bytes.html" title="struct hyper::body::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.93.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../bytes/buf/take/struct.Take.html" title="struct bytes::buf::take::Take">Take</a><Self>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/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><U>(self, next: U) -> <a class="struct" href="../../bytes/buf/chain/struct.Chain.html" title="struct bytes::buf::chain::Chain">Chain</a><Self, U>
|
||
<span class="where">where U: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/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) -> <a class="struct" href="../../bytes/buf/reader/struct.Reader.html" title="struct bytes::buf::reader::Reader">Reader</a><Self>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/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>&[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">&</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">&mut </span>rest);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>rest[..], <span class="kw-2">&</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#143">Source</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples">§</a>Examples</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">&</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 class="doc-anchor" href="#implementer-notes">§</a>Implementer notes</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#176">Source</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[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 a 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 class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"hello world"</span>[..];
|
||
|
||
<span class="macro">assert_eq!</span>(buf.chunk(), <span class="kw-2">&</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">&</span><span class="string">b"world"</span>[..]);</code></pre></div><h5 id="implementer-notes-1"><a class="doc-anchor" href="#implementer-notes-1">§</a>Implementer notes</h5>
|
||
<p>This function should never panic. <code>chunk()</code> should return an empty
|
||
slice <strong>if and only if</strong> <code>remaining()</code> returns 0. In other words,
|
||
<code>chunk()</code> returning an empty slice implies that <code>remaining()</code> will
|
||
return 0 and <code>remaining()</code> returning 0 implies that <code>chunk()</code> will
|
||
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#250">Source</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"hello world"</span>[..];
|
||
|
||
<span class="macro">assert_eq!</span>(buf.chunk(), <span class="kw-2">&</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">&</span><span class="string">b"world"</span>[..]);</code></pre></div><h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
|
||
<p>This function <strong>may</strong> panic if <code>cnt > self.remaining()</code>.</p>
|
||
<h5 id="implementer-notes-2"><a class="doc-anchor" href="#implementer-notes-2">§</a>Implementer notes</h5>
|
||
<p>It is recommended for implementations of <code>advance</code> to panic if <code>cnt > 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#207">Source</a><h4 class="code-header">fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a><'a>(&'a self, dst: &mut [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'a>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 written to <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. The return value is the number of
|
||
slices written to <code>dst</code>. If <code>Buf::remaining()</code> is non-zero, then this
|
||
writes at least one non-empty slice to <code>dst</code>.</p>
|
||
<p>This is a lower level function. Most operations are done with other
|
||
functions.</p>
|
||
<h5 id="implementer-notes-3"><a class="doc-anchor" href="#implementer-notes-3">§</a>Implementer notes</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#269">Source</a><h4 class="code-header">fn <a href="#method.has_remaining" class="fn">has_remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-3">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</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#294">Source</a><h4 class="code-header">fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-4">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::Buf;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</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">&mut </span>dst);
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span><span class="string">b"hello"</span>[..], <span class="kw-2">&</span>dst);
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div><h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
|
||
<p>This function panics if <code>self.remaining() < 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#315">Source</a><h4 class="code-header">fn <a href="#method.get_u8" class="fn">get_u8</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-5">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-2">§</a>Panics</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#343">Source</a><h4 class="code-header">fn <a href="#method.get_i8" class="fn">get_i8</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-6">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-3">§</a>Panics</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#371">Source</a><h4 class="code-header">fn <a href="#method.get_u16" class="fn">get_u16</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-7">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-4">§</a>Panics</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#391">Source</a><h4 class="code-header">fn <a href="#method.get_u16_le" class="fn">get_u16_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-8">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-5">§</a>Panics</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#414">Source</a><h4 class="code-header">fn <a href="#method.get_u16_ne" class="fn">get_u16_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-9">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09 hello"</span>,
|
||
<span class="bool-val">false </span>=> <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 class="doc-anchor" href="#panics-6">§</a>Panics</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#434">Source</a><h4 class="code-header">fn <a href="#method.get_i16" class="fn">get_i16</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-10">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-7">§</a>Panics</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#454">Source</a><h4 class="code-header">fn <a href="#method.get_i16_le" class="fn">get_i16_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-11">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-8">§</a>Panics</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#477">Source</a><h4 class="code-header">fn <a href="#method.get_i16_ne" class="fn">get_i16_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-12">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09 hello"</span>,
|
||
<span class="bool-val">false </span>=> <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 class="doc-anchor" href="#panics-9">§</a>Panics</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#497">Source</a><h4 class="code-header">fn <a href="#method.get_u32" class="fn">get_u32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-13">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-10">§</a>Panics</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#517">Source</a><h4 class="code-header">fn <a href="#method.get_u32_le" class="fn">get_u32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-14">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-11">§</a>Panics</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#540">Source</a><h4 class="code-header">fn <a href="#method.get_u32_ne" class="fn">get_u32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-15">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09\xA0\xA1 hello"</span>,
|
||
<span class="bool-val">false </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_ne());</code></pre></div><h5 id="panics-12"><a class="doc-anchor" href="#panics-12">§</a>Panics</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#560">Source</a><h4 class="code-header">fn <a href="#method.get_i32" class="fn">get_i32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-16">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-13">§</a>Panics</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#580">Source</a><h4 class="code-header">fn <a href="#method.get_i32_le" class="fn">get_i32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-17">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-14">§</a>Panics</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#603">Source</a><h4 class="code-header">fn <a href="#method.get_i32_ne" class="fn">get_i32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-18">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09\xA0\xA1 hello"</span>,
|
||
<span class="bool-val">false </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_ne());</code></pre></div><h5 id="panics-15"><a class="doc-anchor" href="#panics-15">§</a>Panics</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#623">Source</a><h4 class="code-header">fn <a href="#method.get_u64" class="fn">get_u64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-19">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-16">§</a>Panics</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#643">Source</a><h4 class="code-header">fn <a href="#method.get_u64_le" class="fn">get_u64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-20">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-17">§</a>Panics</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#666">Source</a><h4 class="code-header">fn <a href="#method.get_u64_ne" class="fn">get_u64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-21">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>,
|
||
<span class="bool-val">false </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_ne());</code></pre></div><h5 id="panics-18"><a class="doc-anchor" href="#panics-18">§</a>Panics</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#686">Source</a><h4 class="code-header">fn <a href="#method.get_i64" class="fn">get_i64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-22">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-19">§</a>Panics</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#706">Source</a><h4 class="code-header">fn <a href="#method.get_i64_le" class="fn">get_i64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-23">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-20">§</a>Panics</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#729">Source</a><h4 class="code-header">fn <a href="#method.get_i64_ne" class="fn">get_i64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-24">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>,
|
||
<span class="bool-val">false </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_ne());</code></pre></div><h5 id="panics-21"><a class="doc-anchor" href="#panics-21">§</a>Panics</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#749">Source</a><h4 class="code-header">fn <a href="#method.get_u128" class="fn">get_u128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-25">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-22">§</a>Panics</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#769">Source</a><h4 class="code-header">fn <a href="#method.get_u128_le" class="fn">get_u128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-26">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-23">§</a>Panics</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#792">Source</a><h4 class="code-header">fn <a href="#method.get_u128_ne" class="fn">get_u128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-27">§</a>Examples</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">&</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>=> <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>=> <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 class="doc-anchor" href="#panics-24">§</a>Panics</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#812">Source</a><h4 class="code-header">fn <a href="#method.get_i128" class="fn">get_i128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-28">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-25">§</a>Panics</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#832">Source</a><h4 class="code-header">fn <a href="#method.get_i128_le" class="fn">get_i128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-29">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-26">§</a>Panics</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#855">Source</a><h4 class="code-header">fn <a href="#method.get_i128_ne" class="fn">get_i128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-30">§</a>Examples</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">&</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>=> <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>=> <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 class="doc-anchor" href="#panics-27">§</a>Panics</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#876">Source</a><h4 class="code-header">fn <a href="#method.get_uint" class="fn">get_uint</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-31">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-28">§</a>Panics</h5>
|
||
<p>This function panics if there is not enough remaining data in <code>self</code>, or
|
||
if <code>nbytes</code> is greater than 8.</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#897">Source</a><h4 class="code-header">fn <a href="#method.get_uint_le" class="fn">get_uint_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-32">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-29">§</a>Panics</h5>
|
||
<p>This function panics if there is not enough remaining data in <code>self</code>, or
|
||
if <code>nbytes</code> is greater than 8.</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#921">Source</a><h4 class="code-header">fn <a href="#method.get_uint_ne" class="fn">get_uint_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-33">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03 hello"</span>,
|
||
<span class="bool-val">false </span>=> <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 class="doc-anchor" href="#panics-30">§</a>Panics</h5>
|
||
<p>This function panics if there is not enough remaining data in <code>self</code>, or
|
||
if <code>nbytes</code> is greater than 8.</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#946">Source</a><h4 class="code-header">fn <a href="#method.get_int" class="fn">get_int</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-34">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-31">§</a>Panics</h5>
|
||
<p>This function panics if there is not enough remaining data in <code>self</code>, or
|
||
if <code>nbytes</code> is greater than 8.</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#967">Source</a><h4 class="code-header">fn <a href="#method.get_int_le" class="fn">get_int_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-35">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-32">§</a>Panics</h5>
|
||
<p>This function panics if there is not enough remaining data in <code>self</code>, or
|
||
if <code>nbytes</code> is greater than 8.</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#991">Source</a><h4 class="code-header">fn <a href="#method.get_int_ne" class="fn">get_int_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-36">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03 hello"</span>,
|
||
<span class="bool-val">false </span>=> <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 class="doc-anchor" href="#panics-33">§</a>Panics</h5>
|
||
<p>This function panics if there is not enough remaining data in <code>self</code>, or
|
||
if <code>nbytes</code> is greater than 8.</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#1016">Source</a><h4 class="code-header">fn <a href="#method.get_f32" class="fn">get_f32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-37">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-34">§</a>Panics</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#1037">Source</a><h4 class="code-header">fn <a href="#method.get_f32_le" class="fn">get_f32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-38">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-35">§</a>Panics</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#1061">Source</a><h4 class="code-header">fn <a href="#method.get_f32_ne" class="fn">get_f32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-39">§</a>Examples</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">&</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>=> <span class="string">b"\x3F\x99\x99\x9A hello"</span>,
|
||
<span class="bool-val">false </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_ne());</code></pre></div><h5 id="panics-36"><a class="doc-anchor" href="#panics-36">§</a>Panics</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#1082">Source</a><h4 class="code-header">fn <a href="#method.get_f64" class="fn">get_f64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-40">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-37">§</a>Panics</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#1103">Source</a><h4 class="code-header">fn <a href="#method.get_f64_le" class="fn">get_f64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-41">§</a>Examples</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">&</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 class="doc-anchor" href="#panics-38">§</a>Panics</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#1127">Source</a><h4 class="code-header">fn <a href="#method.get_f64_ne" class="fn">get_f64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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 class="doc-anchor" href="#examples-42">§</a>Examples</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">&</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>=> <span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33\x33 hello"</span>,
|
||
<span class="bool-val">false </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_ne());</code></pre></div><h5 id="panics-39"><a class="doc-anchor" href="#panics-39">§</a>Panics</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.try_copy_to_slice" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1161">Source</a><h4 class="code-header">fn <a href="#method.try_copy_to_slice" class="fn">try_copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-43"><a class="doc-anchor" href="#examples-43">§</a>Examples</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">&</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>];
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(()), buf.try_copy_to_slice(<span class="kw-2">&mut </span>dst));
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span><span class="string">b"hello"</span>[..], <span class="kw-2">&</span>dst);
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</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">12</span>];
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">12</span>, available: <span class="number">11</span>}), buf.try_copy_to_slice(<span class="kw-2">&mut </span>dst));
|
||
<span class="macro">assert_eq!</span>(<span class="number">11</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u8" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1204">Source</a><h4 class="code-header">fn <a href="#method.try_get_u8" class="fn">try_get_u8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-44"><a class="doc-anchor" href="#examples-44">§</a>Examples</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">&</span><span class="string">b"\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x08_u8</span>), buf.try_get_u8());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b""</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">1</span>, available: <span class="number">0</span>}), buf.try_get_u8());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i8" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1239">Source</a><h4 class="code-header">fn <a href="#method.try_get_i8" class="fn">try_get_i8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-45"><a class="doc-anchor" href="#examples-45">§</a>Examples</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">&</span><span class="string">b"\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x08_i8</span>), buf.try_get_i8());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b""</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">1</span>, available: <span class="number">0</span>}), buf.try_get_i8());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u16" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1275">Source</a><h4 class="code-header">fn <a href="#method.try_get_u16" class="fn">try_get_u16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-46"><a class="doc-anchor" href="#examples-46">§</a>Examples</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">&</span><span class="string">b"\x08\x09 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809_u16</span>), buf.try_get_u16());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">2</span>, available: <span class="number">1</span>}), buf.try_get_u16());
|
||
<span class="macro">assert_eq!</span>(<span class="number">1</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u16_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1303">Source</a><h4 class="code-header">fn <a href="#method.try_get_u16_le" class="fn">try_get_u16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-47"><a class="doc-anchor" href="#examples-47">§</a>Examples</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">&</span><span class="string">b"\x09\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809_u16</span>), buf.try_get_u16_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">2</span>, available: <span class="number">1</span>}), buf.try_get_u16_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">1</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u16_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1334">Source</a><h4 class="code-header">fn <a href="#method.try_get_u16_ne" class="fn">try_get_u16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-48"><a class="doc-anchor" href="#examples-48">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x09\x08 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809_u16</span>), buf.try_get_u16_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">2</span>, available: <span class="number">1</span>}), buf.try_get_u16_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">1</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i16" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1362">Source</a><h4 class="code-header">fn <a href="#method.try_get_i16" class="fn">try_get_i16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-49"><a class="doc-anchor" href="#examples-49">§</a>Examples</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">&</span><span class="string">b"\x08\x09 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809_i16</span>), buf.try_get_i16());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">2</span>, available: <span class="number">1</span>}), buf.try_get_i16());
|
||
<span class="macro">assert_eq!</span>(<span class="number">1</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i16_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1390">Source</a><h4 class="code-header">fn <a href="#method.try_get_i16_le" class="fn">try_get_i16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section></summary><div class="docblock"><p>Gets an signed 16 bit integer from <code>self</code> in little-endian byte order.</p>
|
||
<p>The current position is advanced by 2.</p>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-50"><a class="doc-anchor" href="#examples-50">§</a>Examples</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">&</span><span class="string">b"\x09\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809_i16</span>), buf.try_get_i16_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">2</span>, available: <span class="number">1</span>}), buf.try_get_i16_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">1</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i16_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1421">Source</a><h4 class="code-header">fn <a href="#method.try_get_i16_ne" class="fn">try_get_i16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-51"><a class="doc-anchor" href="#examples-51">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x09\x08 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809_i16</span>), buf.try_get_i16_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">2</span>, available: <span class="number">1</span>}), buf.try_get_i16_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">1</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u32" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1449">Source</a><h4 class="code-header">fn <a href="#method.try_get_u32" class="fn">try_get_u32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section></summary><div class="docblock"><p>Gets an unsigned 32 bit integer from <code>self</code> in big-endian byte order.</p>
|
||
<p>The current position is advanced by 4.</p>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-52"><a class="doc-anchor" href="#examples-52">§</a>Examples</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">&</span><span class="string">b"\x08\x09\xA0\xA1 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809A0A1</span>), buf.try_get_u32());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_u32());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u32_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1477">Source</a><h4 class="code-header">fn <a href="#method.try_get_u32_le" class="fn">try_get_u32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section></summary><div class="docblock"><p>Gets an unsigned 32 bit integer from <code>self</code> in little-endian byte order.</p>
|
||
<p>The current position is advanced by 4.</p>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-53"><a class="doc-anchor" href="#examples-53">§</a>Examples</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">&</span><span class="string">b"\xA1\xA0\x09\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809A0A1_u32</span>), buf.try_get_u32_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08\x09\xA0"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_u32_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u32_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1508">Source</a><h4 class="code-header">fn <a href="#method.try_get_u32_ne" class="fn">try_get_u32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-54"><a class="doc-anchor" href="#examples-54">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09\xA0\xA1 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\xA1\xA0\x09\x08 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809A0A1_u32</span>), buf.try_get_u32_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08\x09\xA0"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_u32_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i32" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1536">Source</a><h4 class="code-header">fn <a href="#method.try_get_i32" class="fn">try_get_i32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-55"><a class="doc-anchor" href="#examples-55">§</a>Examples</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">&</span><span class="string">b"\x08\x09\xA0\xA1 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809A0A1_i32</span>), buf.try_get_i32());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_i32());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i32_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1564">Source</a><h4 class="code-header">fn <a href="#method.try_get_i32_le" class="fn">try_get_i32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-56"><a class="doc-anchor" href="#examples-56">§</a>Examples</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">&</span><span class="string">b"\xA1\xA0\x09\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809A0A1_i32</span>), buf.try_get_i32_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08\x09\xA0"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_i32_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i32_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1595">Source</a><h4 class="code-header">fn <a href="#method.try_get_i32_ne" class="fn">try_get_i32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-57"><a class="doc-anchor" href="#examples-57">§</a>Examples</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">&</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>=> <span class="string">b"\x08\x09\xA0\xA1 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\xA1\xA0\x09\x08 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0809A0A1_i32</span>), buf.try_get_i32_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08\x09\xA0"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_i32_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u64" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1623">Source</a><h4 class="code-header">fn <a href="#method.try_get_u64" class="fn">try_get_u64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-58"><a class="doc-anchor" href="#examples-58">§</a>Examples</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">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0102030405060708_u64</span>), buf.try_get_u64());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_u64());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u64_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1651">Source</a><h4 class="code-header">fn <a href="#method.try_get_u64_le" class="fn">try_get_u64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-59"><a class="doc-anchor" href="#examples-59">§</a>Examples</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">&</span><span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0102030405060708_u64</span>), buf.try_get_u64_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08\x07\x06\x05\x04\x03\x02"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_u64_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u64_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1682">Source</a><h4 class="code-header">fn <a href="#method.try_get_u64_ne" class="fn">try_get_u64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-60"><a class="doc-anchor" href="#examples-60">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0102030405060708_u64</span>), buf.try_get_u64_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_u64_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i64" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1710">Source</a><h4 class="code-header">fn <a href="#method.try_get_i64" class="fn">try_get_i64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-61"><a class="doc-anchor" href="#examples-61">§</a>Examples</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">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0102030405060708_i64</span>), buf.try_get_i64());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_i64());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i64_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1738">Source</a><h4 class="code-header">fn <a href="#method.try_get_i64_le" class="fn">try_get_i64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-62"><a class="doc-anchor" href="#examples-62">§</a>Examples</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">&</span><span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0102030405060708_i64</span>), buf.try_get_i64_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x08\x07\x06\x05\x04\x03\x02"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_i64_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i64_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1769">Source</a><h4 class="code-header">fn <a href="#method.try_get_i64_ne" class="fn">try_get_i64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-63"><a class="doc-anchor" href="#examples-63">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x0102030405060708_i64</span>), buf.try_get_i64_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_i64_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u128" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1797">Source</a><h4 class="code-header">fn <a href="#method.try_get_u128" class="fn">try_get_u128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-64"><a class="doc-anchor" href="#examples-64">§</a>Examples</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">&</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="prelude-val">Ok</span>(<span class="number">0x01020304050607080910111213141516_u128</span>), buf.try_get_u128());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">16</span>, available: <span class="number">15</span>}), buf.try_get_u128());
|
||
<span class="macro">assert_eq!</span>(<span class="number">15</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u128_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1825">Source</a><h4 class="code-header">fn <a href="#method.try_get_u128_le" class="fn">try_get_u128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-65"><a class="doc-anchor" href="#examples-65">§</a>Examples</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">&</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="prelude-val">Ok</span>(<span class="number">0x01020304050607080910111213141516_u128</span>), buf.try_get_u128_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">16</span>, available: <span class="number">15</span>}), buf.try_get_u128_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">15</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_u128_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1856">Source</a><h4 class="code-header">fn <a href="#method.try_get_u128_ne" class="fn">try_get_u128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-66"><a class="doc-anchor" href="#examples-66">§</a>Examples</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">&</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>=> <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>=> <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="prelude-val">Ok</span>(<span class="number">0x01020304050607080910111213141516_u128</span>), buf.try_get_u128_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">16</span>, available: <span class="number">15</span>}), buf.try_get_u128_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">15</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i128" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1884">Source</a><h4 class="code-header">fn <a href="#method.try_get_i128" class="fn">try_get_i128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-67"><a class="doc-anchor" href="#examples-67">§</a>Examples</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">&</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="prelude-val">Ok</span>(<span class="number">0x01020304050607080910111213141516_i128</span>), buf.try_get_i128());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">16</span>, available: <span class="number">15</span>}), buf.try_get_i128());
|
||
<span class="macro">assert_eq!</span>(<span class="number">15</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i128_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1912">Source</a><h4 class="code-header">fn <a href="#method.try_get_i128_le" class="fn">try_get_i128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-68"><a class="doc-anchor" href="#examples-68">§</a>Examples</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">&</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="prelude-val">Ok</span>(<span class="number">0x01020304050607080910111213141516_i128</span>), buf.try_get_i128_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">16</span>, available: <span class="number">15</span>}), buf.try_get_i128_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">15</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_i128_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1943">Source</a><h4 class="code-header">fn <a href="#method.try_get_i128_ne" class="fn">try_get_i128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-69"><a class="doc-anchor" href="#examples-69">§</a>Examples</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">&</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>=> <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>=> <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="prelude-val">Ok</span>(<span class="number">0x01020304050607080910111213141516_i128</span>), buf.try_get_i128_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">16</span>, available: <span class="number">15</span>}), buf.try_get_i128_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">15</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_uint" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#1975">Source</a><h4 class="code-header">fn <a href="#method.try_get_uint" class="fn">try_get_uint</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-70"><a class="doc-anchor" href="#examples-70">§</a>Examples</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">&</span><span class="string">b"\x01\x02\x03 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x010203_u64</span>), buf.try_get_uint(<span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_uint(<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div><h5 id="panics-40"><a class="doc-anchor" href="#panics-40">§</a>Panics</h5>
|
||
<p>This function panics if <code>nbytes</code> > 8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_uint_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2007">Source</a><h4 class="code-header">fn <a href="#method.try_get_uint_le" class="fn">try_get_uint_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-71"><a class="doc-anchor" href="#examples-71">§</a>Examples</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">&</span><span class="string">b"\x03\x02\x01 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x010203_u64</span>), buf.try_get_uint_le(<span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_uint_le(<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div><h5 id="panics-41"><a class="doc-anchor" href="#panics-41">§</a>Panics</h5>
|
||
<p>This function panics if <code>nbytes</code> > 8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_uint_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2045">Source</a><h4 class="code-header">fn <a href="#method.try_get_uint_ne" class="fn">try_get_uint_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-72"><a class="doc-anchor" href="#examples-72">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x03\x02\x01 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x010203_u64</span>), buf.try_get_uint_ne(<span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&</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>=> <span class="string">b"\x01\x02\x03"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x03\x02\x01"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_uint_ne(<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div><h5 id="panics-42"><a class="doc-anchor" href="#panics-42">§</a>Panics</h5>
|
||
<p>This function panics if <code>nbytes</code> is greater than 8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_int" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2081">Source</a><h4 class="code-header">fn <a href="#method.try_get_int" class="fn">try_get_int</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-73"><a class="doc-anchor" href="#examples-73">§</a>Examples</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">&</span><span class="string">b"\x01\x02\x03 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x010203_i64</span>), buf.try_get_int(<span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_int(<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div><h5 id="panics-43"><a class="doc-anchor" href="#panics-43">§</a>Panics</h5>
|
||
<p>This function panics if <code>nbytes</code> is greater than 8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_int_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2113">Source</a><h4 class="code-header">fn <a href="#method.try_get_int_le" class="fn">try_get_int_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-74"><a class="doc-anchor" href="#examples-74">§</a>Examples</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">&</span><span class="string">b"\x03\x02\x01 hello"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x010203_i64</span>), buf.try_get_int_le(<span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x01\x02\x03"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_int_le(<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div><h5 id="panics-44"><a class="doc-anchor" href="#panics-44">§</a>Panics</h5>
|
||
<p>This function panics if <code>nbytes</code> is greater than 8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_int_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2151">Source</a><h4 class="code-header">fn <a href="#method.try_get_int_ne" class="fn">try_get_int_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-75"><a class="doc-anchor" href="#examples-75">§</a>Examples</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">&</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>=> <span class="string">b"\x01\x02\x03 hello"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x03\x02\x01 hello"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">0x010203_i64</span>), buf.try_get_int_ne(<span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf: <span class="kw-2">&</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>=> <span class="string">b"\x01\x02\x03"</span>,
|
||
<span class="bool-val">false </span>=> <span class="string">b"\x03\x02\x01"</span>,
|
||
};
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_int_ne(<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div><h5 id="panics-45"><a class="doc-anchor" href="#panics-45">§</a>Panics</h5>
|
||
<p>This function panics if <code>nbytes</code> is greater than 8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_f32" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2184">Source</a><h4 class="code-header">fn <a href="#method.try_get_f32" class="fn">try_get_f32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-76"><a class="doc-anchor" href="#examples-76">§</a>Examples</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">&</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());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x3F\x99\x99"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_f32());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_f32_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2213">Source</a><h4 class="code-header">fn <a href="#method.try_get_f32_le" class="fn">try_get_f32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-77"><a class="doc-anchor" href="#examples-77">§</a>Examples</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">&</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());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x3F\x99\x99"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_f32_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_f32_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2245">Source</a><h4 class="code-header">fn <a href="#method.try_get_f32_ne" class="fn">try_get_f32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-78"><a class="doc-anchor" href="#examples-78">§</a>Examples</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">&</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>=> <span class="string">b"\x3F\x99\x99\x9A hello"</span>,
|
||
<span class="bool-val">false </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_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x3F\x99\x99"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">4</span>, available: <span class="number">3</span>}), buf.try_get_f32_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_f64" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2274">Source</a><h4 class="code-header">fn <a href="#method.try_get_f64" class="fn">try_get_f64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-79"><a class="doc-anchor" href="#examples-79">§</a>Examples</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">&</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());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_f64());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_f64_le" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2303">Source</a><h4 class="code-header">fn <a href="#method.try_get_f64_le" class="fn">try_get_f64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-80"><a class="doc-anchor" href="#examples-80">§</a>Examples</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">&</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());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_f64_le());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_f64_ne" class="method"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2335">Source</a><h4 class="code-header">fn <a href="#method.try_get_f64_ne" class="fn">try_get_f64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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>
|
||
<p>Returns <code>Err(TryGetError)</code> when there are not enough
|
||
remaining bytes to read the value.</p>
|
||
<h5 id="examples-81"><a class="doc-anchor" href="#examples-81">§</a>Examples</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">&</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>=> <span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33\x33 hello"</span>,
|
||
<span class="bool-val">false </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_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">6</span>, buf.remaining());</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytes::{Buf, TryGetError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="kw-2">&</span><span class="string">b"\x3F\xF3\x33\x33\x33\x33\x33"</span>[..];
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Err</span>(TryGetError{requested: <span class="number">8</span>, available: <span class="number">7</span>}), buf.try_get_f64_ne());
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, buf.remaining());</code></pre></div></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#2358">Source</a><h4 class="code-header">fn <a href="#method.copy_to_bytes" class="fn">copy_to_bytes</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.Bytes.html" title="struct hyper::body::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-82"><a class="doc-anchor" href="#examples-82">§</a>Examples</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">&</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">&</span>bytes[..], <span class="kw-2">&</span><span class="string">b"hello"</span>[..]);</code></pre></div><h5 id="panics-46"><a class="doc-anchor" href="#panics-46">§</a>Panics</h5>
|
||
<p>This function panics if <code>len > self.remaining()</code>.</p>
|
||
</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#2394-2396">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.93.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../bytes/buf/take/struct.Take.html" title="struct bytes::buf::take::Take">Take</a><Self><div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/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-83"><a class="doc-anchor" href="#examples-83">§</a>Examples</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">&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">&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#2416-2418">Source</a><h4 class="code-header">fn <a href="#method.chain" class="fn">chain</a><U>(self, next: U) -> <a class="struct" href="../../bytes/buf/chain/struct.Chain.html" title="struct bytes::buf::chain::Chain">Chain</a><Self, U><div class="where">where
|
||
U: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/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-84"><a class="doc-anchor" href="#examples-84">§</a>Examples</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">&</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#2448-2450">Source</a><h4 class="code-header">fn <a href="#method.reader" class="fn">reader</a>(self) -> <a class="struct" href="../../bytes/buf/reader/struct.Reader.html" title="struct bytes::buf::reader::Reader">Reader</a><Self><div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/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-85"><a class="doc-anchor" href="#examples-85">§</a>Examples</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">&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">&</span>dst[..<span class="number">11</span>], <span class="kw-2">&</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#2889">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 hyper::body::Buf">Buf</a> for &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2891">Source</a><a href="#method.remaining" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2896">Source</a><a href="#method.chunk" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section><section id="method.advance" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2901">Source</a><a href="#method.advance" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</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#2913">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>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</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#7">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 hyper::body::Buf">Buf</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/collections/vec_deque/struct.VecDeque.html" title="struct alloc::collections::vec_deque::VecDeque">VecDeque</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>></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#8">Source</a><a href="#method.remaining-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#12">Source</a><a href="#method.chunk-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section><section id="method.chunks_vectored-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/vec_deque.rs.html#22">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><'a>(&'a self, dst: &mut [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'a>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section><section id="method.advance-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/vec_deque.rs.html#37">Source</a><a href="#method.advance-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2881">Source</a><a href="#impl-Buf-for-%26mut+T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut T</a><div class="where">where
|
||
T: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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#2882">Source</a><a href="#method.remaining-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">Source</a><a href="#method.chunk-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[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#2882">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><'b>(&'b self, dst: &mut [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'b>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section><section id="method.advance-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.advance-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a></h4></section><section id="method.get_u128-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_u128-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u128" class="fn">get_u128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a></h4></section><section id="method.get_u128_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_u128_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u128_le" class="fn">get_u128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a></h4></section><section id="method.get_u128_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_u128_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u128_ne" class="fn">get_u128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a></h4></section><section id="method.get_i128-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_i128-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i128" class="fn">get_i128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a></h4></section><section id="method.get_i128_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_i128_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i128_le" class="fn">get_i128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a></h4></section><section id="method.get_i128_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_i128_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i128_ne" class="fn">get_i128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</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#2882">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2882">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a></h4></section><section id="method.get_f32-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_f32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f32" class="fn">get_f32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a></h4></section><section id="method.get_f32_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_f32_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f32_le" class="fn">get_f32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a></h4></section><section id="method.get_f32_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_f32_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f32_ne" class="fn">get_f32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a></h4></section><section id="method.get_f64-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_f64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f64" class="fn">get_f64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a></h4></section><section id="method.get_f64_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_f64_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f64_le" class="fn">get_f64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a></h4></section><section id="method.get_f64_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.get_f64_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f64_ne" class="fn">get_f64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a></h4></section><section id="method.try_copy_to_slice-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_copy_to_slice-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_copy_to_slice" class="fn">try_copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u8-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u8-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u8" class="fn">try_get_u8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i8-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i8-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i8" class="fn">try_get_i8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u16-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u16-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u16" class="fn">try_get_u16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u16_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u16_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u16_le" class="fn">try_get_u16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u16_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u16_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u16_ne" class="fn">try_get_u16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i16-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i16-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i16" class="fn">try_get_i16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i16_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i16_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i16_le" class="fn">try_get_i16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i16_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i16_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i16_ne" class="fn">try_get_i16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u32-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u32" class="fn">try_get_u32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u32_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u32_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u32_le" class="fn">try_get_u32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u32_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u32_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u32_ne" class="fn">try_get_u32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i32-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i32" class="fn">try_get_i32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i32_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i32_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i32_le" class="fn">try_get_i32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i32_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i32_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i32_ne" class="fn">try_get_i32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u64-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u64" class="fn">try_get_u64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u64_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u64_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u64_le" class="fn">try_get_u64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u64_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u64_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u64_ne" class="fn">try_get_u64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i64-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i64" class="fn">try_get_i64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i64_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i64_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i64_le" class="fn">try_get_i64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i64_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i64_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i64_ne" class="fn">try_get_i64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u128-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u128-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u128" class="fn">try_get_u128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u128_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u128_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u128_le" class="fn">try_get_u128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u128_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_u128_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u128_ne" class="fn">try_get_u128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i128-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i128-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i128" class="fn">try_get_i128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i128_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i128_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i128_le" class="fn">try_get_i128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i128_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_i128_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i128_ne" class="fn">try_get_i128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_uint-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_uint-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_uint" class="fn">try_get_uint</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_uint_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_uint_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_uint_le" class="fn">try_get_uint_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_uint_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_uint_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_uint_ne" class="fn">try_get_uint_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_int-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_int-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_int" class="fn">try_get_int</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_int_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_int_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_int_le" class="fn">try_get_int_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_int_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_int_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_int_ne" class="fn">try_get_int_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f32-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_f32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f32" class="fn">try_get_f32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f32_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_f32_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f32_le" class="fn">try_get_f32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f32_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_f32_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f32_ne" class="fn">try_get_f32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f64-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_f64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f64" class="fn">try_get_f64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f64_le-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_f64_le-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f64_le" class="fn">try_get_f64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f64_ne-1" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2882">Source</a><a href="#method.try_get_f64_ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f64_ne" class="fn">try_get_f64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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#2882">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>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.Bytes.html" title="struct hyper::body::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#2885">Source</a><a href="#impl-Buf-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T><div class="where">where
|
||
T: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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#2886">Source</a><a href="#method.remaining-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">Source</a><a href="#method.chunk-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section><section id="method.chunks_vectored-3" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.chunks_vectored-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.chunks_vectored" class="fn">chunks_vectored</a><'b>(&'b self, dst: &mut [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'b>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">Source</a><a href="#method.advance-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section><section id="method.copy_to_slice-3" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.copy_to_slice-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.copy_to_slice" class="fn">copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a></h4></section><section id="method.get_u128-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_u128-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u128" class="fn">get_u128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a></h4></section><section id="method.get_u128_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_u128_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u128_le" class="fn">get_u128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a></h4></section><section id="method.get_u128_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_u128_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_u128_ne" class="fn">get_u128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a></h4></section><section id="method.get_i128-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_i128-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i128" class="fn">get_i128</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a></h4></section><section id="method.get_i128_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_i128_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i128_le" class="fn">get_i128_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a></h4></section><section id="method.get_i128_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_i128_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_i128_ne" class="fn">get_i128_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</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#2886">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2886">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>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a></h4></section><section id="method.get_f32-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_f32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f32" class="fn">get_f32</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a></h4></section><section id="method.get_f32_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_f32_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f32_le" class="fn">get_f32_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a></h4></section><section id="method.get_f32_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_f32_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f32_ne" class="fn">get_f32_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a></h4></section><section id="method.get_f64-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_f64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f64" class="fn">get_f64</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a></h4></section><section id="method.get_f64_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_f64_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f64_le" class="fn">get_f64_le</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a></h4></section><section id="method.get_f64_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.get_f64_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.get_f64_ne" class="fn">get_f64_ne</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a></h4></section><section id="method.try_copy_to_slice-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_copy_to_slice-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_copy_to_slice" class="fn">try_copy_to_slice</a>(&mut self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u8-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u8-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u8" class="fn">try_get_u8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i8-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i8-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i8" class="fn">try_get_i8</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u16-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u16-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u16" class="fn">try_get_u16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u16_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u16_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u16_le" class="fn">try_get_u16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u16_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u16_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u16_ne" class="fn">try_get_u16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i16-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i16-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i16" class="fn">try_get_i16</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i16_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i16_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i16_le" class="fn">try_get_i16_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i16_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i16_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i16_ne" class="fn">try_get_i16_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u32-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u32" class="fn">try_get_u32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u32_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u32_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u32_le" class="fn">try_get_u32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u32_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u32_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u32_ne" class="fn">try_get_u32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i32-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i32" class="fn">try_get_i32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i32_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i32_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i32_le" class="fn">try_get_i32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i32_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i32_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i32_ne" class="fn">try_get_i32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u64-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u64" class="fn">try_get_u64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u64_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u64_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u64_le" class="fn">try_get_u64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u64_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u64_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u64_ne" class="fn">try_get_u64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i64-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i64" class="fn">try_get_i64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i64_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i64_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i64_le" class="fn">try_get_i64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i64_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i64_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i64_ne" class="fn">try_get_i64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u128-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u128-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u128" class="fn">try_get_u128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u128_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u128_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u128_le" class="fn">try_get_u128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_u128_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_u128_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_u128_ne" class="fn">try_get_u128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i128-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i128-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i128" class="fn">try_get_i128</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i128_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i128_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i128_le" class="fn">try_get_i128_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_i128_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_i128_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_i128_ne" class="fn">try_get_i128_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_uint-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_uint-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_uint" class="fn">try_get_uint</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_uint_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_uint_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_uint_le" class="fn">try_get_uint_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_uint_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_uint_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_uint_ne" class="fn">try_get_uint_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_int-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_int-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_int" class="fn">try_get_int</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_int_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_int_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_int_le" class="fn">try_get_int_le</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_int_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_int_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_int_ne" class="fn">try_get_int_ne</a>(&mut self, nbytes: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f32-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_f32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f32" class="fn">try_get_f32</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f32_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_f32_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f32_le" class="fn">try_get_f32_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f32_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_f32_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f32_ne" class="fn">try_get_f32_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f64-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_f64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f64" class="fn">try_get_f64</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f64_le-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_f64_le-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f64_le" class="fn">try_get_f64_le</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</a>></h4></section><section id="method.try_get_f64_ne-2" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2886">Source</a><a href="#method.try_get_f64_ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_get_f64_ne" class="fn">try_get_f64_ne</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>, <a class="struct" href="../../bytes/struct.TryGetError.html" title="struct bytes::TryGetError">TryGetError</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#2886">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>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.Bytes.html" title="struct hyper::body::Bytes">Bytes</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#2927">Source</a><a href="#impl-Buf-for-Cursor%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a><T><div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]>,</div></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>std</code></strong> only.</div></span></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#2929">Source</a><a href="#method.remaining-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.remaining" class="fn">remaining</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/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#2934">Source</a><a href="#method.chunk-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.chunk" class="fn">chunk</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section><section id="method.advance-4" class="method trait-impl"><a class="src rightside" href="../../src/bytes/buf/buf_impl.rs.html#2941">Source</a><a href="#method.advance-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.advance" class="fn">advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</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-BytesMut" class="impl"><a class="src rightside" href="../../src/bytes/bytes_mut.rs.html#1143">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 hyper::body::Buf">Buf</a> for <a class="struct" href="../../bytes/bytes_mut/struct.BytesMut.html" title="struct bytes::bytes_mut::BytesMut">BytesMut</a></h3></section><section id="impl-Buf-for-Bytes" class="impl"><a class="src rightside" href="../../src/bytes/bytes.rs.html#694">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 hyper::body::Buf">Buf</a> for <a class="struct" href="struct.Bytes.html" title="struct hyper::body::Bytes">Bytes</a></h3></section><section id="impl-Buf-for-Take%3CT%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/take.rs.html#135">Source</a><a href="#impl-Buf-for-Take%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> for <a class="struct" href="../../bytes/buf/take/struct.Take.html" title="struct bytes::buf::take::Take">Take</a><T><div class="where">where
|
||
T: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,</div></h3></section><section id="impl-Buf-for-Chain%3CT,+U%3E" class="impl"><a class="src rightside" href="../../src/bytes/buf/chain.rs.html#130-133">Source</a><a href="#impl-Buf-for-Chain%3CT,+U%3E" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a> for <a class="struct" href="../../bytes/buf/chain/struct.Chain.html" title="struct bytes::buf::chain::Chain">Chain</a><T, U><div class="where">where
|
||
T: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,
|
||
U: <a class="trait" href="trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,</div></h3></section></div><script src="../../trait.impl/bytes/buf/buf_impl/trait.Buf.js" data-ignore-extern-crates="alloc,std,bytes" async></script><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html> |