mentat/bytes/trait.IntoBuf.html
2018-08-22 17:04:13 +00:00

221 lines
No EOL
32 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `IntoBuf` trait in crate `bytes`.">
<meta name="keywords" content="rust, rustlang, rust-lang, IntoBuf">
<title>bytes::IntoBuf - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
<link rel="stylesheet" type="text/css" href="../dark.css">
<link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle">
<script src="../storage.js"></script>
</head>
<body class="rustdoc trait">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<div class="sidebar-menu">&#9776;</div>
<p class='location'>Trait IntoBuf</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Buf">Buf</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.into_buf">into_buf</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-IntoBuf">&amp;&#39;a [u8]</a><a href="#impl-IntoBuf">&amp;&#39;a mut [u8]</a><a href="#impl-IntoBuf">&amp;&#39;a str</a><a href="#impl-IntoBuf">Vec&lt;u8&gt;</a><a href="#impl-IntoBuf">&amp;&#39;a Vec&lt;u8&gt;</a><a href="#impl-IntoBuf">&amp;&#39;a &amp;&#39;static [u8]</a><a href="#impl-IntoBuf">&amp;&#39;a &amp;&#39;static str</a><a href="#impl-IntoBuf">String</a><a href="#impl-IntoBuf">&amp;&#39;a String</a><a href="#impl-IntoBuf">u8</a><a href="#impl-IntoBuf">i8</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>bytes</a></p><script>window.sidebarCurrent = {name: 'IntoBuf', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
</nav>
<div class="theme-picker">
<button id="theme-picker" aria-label="Pick another theme!">
<img src="../brush.svg" width="18" alt="Pick another theme!">
</button>
<div id="theme-choices"></div>
</div>
<script src="../theme.js"></script>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>bytes</a>::<wbr><a class="trait" href=''>IntoBuf</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#26-48' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait IntoBuf {
type <a href='#associatedtype.Buf' class="type">Buf</a>: <a class="trait" href="../bytes/buf/trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>;
fn <a href='#tymethod.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a>;
}</pre><div class='docblock'><p>Conversion into a <code>Buf</code></p>
<p>An <code>IntoBuf</code> implementation defines how to convert a value into a <code>Buf</code>.
This is common for types that represent byte storage of some kind. <code>IntoBuf</code>
may be implemented directly for types or on references for those types.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">bytes</span>::{<span class="ident">Buf</span>, <span class="ident">IntoBuf</span>, <span class="ident">BigEndian</span>};
<span class="kw">let</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="string">b&quot;\x00\x01hello world&quot;</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buf</span> <span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">into_buf</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">1</span>, <span class="ident">buf</span>.<span class="ident">get_u16</span>::<span class="op">&lt;</span><span class="ident">BigEndian</span><span class="op">&gt;</span>());
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rest</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">11</span>];
<span class="ident">buf</span>.<span class="ident">copy_to_slice</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">rest</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">rest</span>);</pre>
</div>
<h2 id='associated-types' class='small-section-header'>
Associated Types<a href='#associated-types' class='anchor'></a>
</h2>
<div class='methods'>
<h3 id='associatedtype.Buf' class='method'><span id='Buf.t' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a>: <a class="trait" href="../bytes/buf/trait.Buf.html" title="trait bytes::buf::Buf">Buf</a></code></span></h3><div class='docblock'><p>The <code>Buf</code> type that <code>self</code> is being converted into</p>
</div></div>
<h2 id='required-methods' class='small-section-header'>
Required Methods<a href='#required-methods' class='anchor'></a>
</h2>
<div class='methods'>
<h3 id='tymethod.into_buf' class='method'><span id='into_buf.v' class='invisible'><code>fn <a href='#tymethod.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span></h3><div class='docblock'><p>Creates a <code>Buf</code> from a value.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">bytes</span>::{<span class="ident">Buf</span>, <span class="ident">IntoBuf</span>, <span class="ident">BigEndian</span>};
<span class="kw">let</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="string">b&quot;\x00\x01hello world&quot;</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buf</span> <span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">into_buf</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">1</span>, <span class="ident">buf</span>.<span class="ident">get_u16</span>::<span class="op">&lt;</span><span class="ident">BigEndian</span><span class="op">&gt;</span>());
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rest</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">11</span>];
<span class="ident">buf</span>.<span class="ident">copy_to_slice</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">rest</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">rest</span>);</pre>
</div></div>
<h2 id='foreign-impls' class='small-section-header'>
Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
</h2>
<h3 id='impl-IntoBuf' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><a href='#impl-IntoBuf' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#58-64' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-1' class="type"><span id='Buf.t-1' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf' class="method"><span id='into_buf.v-1' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#61-63' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-1' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><a href='#impl-IntoBuf-1' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#66-72' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-2' class="type"><span id='Buf.t-2' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-1' class="method"><span id='into_buf.v-2' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#69-71' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-2' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><a href='#impl-IntoBuf-2' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#74-80' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-3' class="type"><span id='Buf.t-3' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-2' class="method"><span id='into_buf.v-3' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#77-79' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-3' class='impl'><span class='in-band'><code>impl <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;</code><a href='#impl-IntoBuf-3' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#82-88' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-4' class="type"><span id='Buf.t-4' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;&gt;</code></span></h4>
<h4 id='method.into_buf-3' class="method"><span id='into_buf.v-4' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#85-87' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-4' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for &amp;'a <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;</code><a href='#impl-IntoBuf-4' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#90-96' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-5' class="type"><span id='Buf.t-5' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-4' class="method"><span id='into_buf.v-5' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#93-95' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-5' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><a href='#impl-IntoBuf-5' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#100-106' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-6' class="type"><span id='Buf.t-6' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-5' class="method"><span id='into_buf.v-6' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#103-105' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-6' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for &amp;'a &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><a href='#impl-IntoBuf-6' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#108-114' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-7' class="type"><span id='Buf.t-7' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-6' class="method"><span id='into_buf.v-7' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#111-113' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-7' class='impl'><span class='in-band'><code>impl <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a href='#impl-IntoBuf-7' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#116-122' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-8' class="type"><span id='Buf.t-8' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;&gt;</code></span></h4>
<h4 id='method.into_buf-7' class="method"><span id='into_buf.v-8' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#119-121' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-8' class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for &amp;'a <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a href='#impl-IntoBuf-8' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#124-130' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-9' class="type"><span id='Buf.t-9' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-8' class="method"><span id='into_buf.v-9' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#127-129' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-9' class='impl'><span class='in-band'><code>impl <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a href='#impl-IntoBuf-9' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#132-138' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-10' class="type"><span id='Buf.t-10' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 1]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-9' class="method"><span id='into_buf.v-10' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#135-137' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-IntoBuf-10' class='impl'><span class='in-band'><code>impl <a class="trait" href="../bytes/buf/trait.IntoBuf.html" title="trait bytes::buf::IntoBuf">IntoBuf</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a></code><a href='#impl-IntoBuf-10' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#140-146' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='associatedtype.Buf-11' class="type"><span id='Buf.t-11' class='invisible'><code>type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 1]</a>&gt;</code></span></h4>
<h4 id='method.into_buf-10' class="method"><span id='into_buf.v-11' class='invisible'><code>fn <a href='#method.into_buf' class='fnname'>into_buf</a>(self) -&gt; Self::<a class="type" href="../bytes/buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::IntoBuf::Buf">Buf</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#143-145' title='goto source code'>[src]</a></span></h4>
</div></span>
<h2 id='implementors' class='small-section-header'>
Implementors<a href='#implementors' class='anchor'></a>
</h2>
<ul class='item-list' id='implementors-list'>
<li><div class='out-of-band'><a class='srclink' href='../src/bytes/buf/into_buf.rs.html#50-56' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../bytes/buf/trait.Buf.html" title="trait bytes::buf::Buf">Buf</a>&gt; IntoBuf for T<span class="where fmt-newline"> type <a href='#associatedtype.Buf' class="type">Buf</a> = Self;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/bytes/bytes.rs.html#797-803' title='goto source code'>[src]</a></div><code>impl IntoBuf for <a class="struct" href="../bytes/struct.Bytes.html" title="struct bytes::Bytes">Bytes</a><span class="where fmt-newline"> type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;Self&gt;;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/bytes/bytes.rs.html#805-811' title='goto source code'>[src]</a></div><code>impl&lt;'a&gt; IntoBuf for &amp;'a <a class="struct" href="../bytes/struct.Bytes.html" title="struct bytes::Bytes">Bytes</a><span class="where fmt-newline"> type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;Self&gt;;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/bytes/bytes.rs.html#1511-1517' title='goto source code'>[src]</a></div><code>impl IntoBuf for <a class="struct" href="../bytes/struct.BytesMut.html" title="struct bytes::BytesMut">BytesMut</a><span class="where fmt-newline"> type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;Self&gt;;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../src/bytes/bytes.rs.html#1519-1525' title='goto source code'>[src]</a></div><code>impl&lt;'a&gt; IntoBuf for &amp;'a <a class="struct" href="../bytes/struct.BytesMut.html" title="struct bytes::BytesMut">BytesMut</a><span class="where fmt-newline"> type <a href='#associatedtype.Buf' class="type">Buf</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;&amp;'a <a class="struct" href="../bytes/struct.BytesMut.html" title="struct bytes::BytesMut">BytesMut</a>&gt;;</span></code></li>
</ul><script type="text/javascript" async
src="../implementors/bytes/trait.IntoBuf.js">
</script></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt><kbd>?</kbd></dt>
<dd>Show this help dialog</dd>
<dt><kbd>S</kbd></dt>
<dd>Focus the search field</dd>
<dt><kbd></kbd></dt>
<dd>Move up in search results</dd>
<dt><kbd></kbd></dt>
<dd>Move down in search results</dd>
<dt><kbd></kbd></dt>
<dd>Switch tab</dd>
<dt><kbd>&#9166;</kbd></dt>
<dd>Go to active search result</dd>
<dt><kbd>+</kbd></dt>
<dd>Expand all sections</dd>
<dt><kbd>-</kbd></dt>
<dd>Collapse all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "bytes";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>