1082 lines
327 KiB
HTML
1082 lines
327 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="API documentation for the Rust `Bytes` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, Bytes"><title>actix_web::web::Bytes - 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="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">☰</div><a href='../../actix_web/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Bytes</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.advance">advance</a><a href="#method.clear">clear</a><a href="#method.extend_from_slice">extend_from_slice</a><a href="#method.from_static">from_static</a><a href="#method.is_empty">is_empty</a><a href="#method.len">len</a><a href="#method.new">new</a><a href="#method.slice">slice</a><a href="#method.slice_from">slice_from</a><a href="#method.slice_ref">slice_ref</a><a href="#method.slice_to">slice_to</a><a href="#method.split_off">split_off</a><a href="#method.split_to">split_to</a><a href="#method.truncate">truncate</a><a href="#method.try_mut">try_mut</a><a href="#method.with_capacity">with_capacity</a></div><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=[u8]></a><div class="sidebar-links"><a href="#method.align_to">align_to</a><a href="#method.align_to_mut">align_to_mut</a><a href="#method.as_mut_ptr">as_mut_ptr</a><a href="#method.as_mut_ptr_range">as_mut_ptr_range</a><a href="#method.as_ptr">as_ptr</a><a href="#method.as_ptr_range">as_ptr_range</a><a href="#method.binary_search">binary_search</a><a href="#method.binary_search_by">binary_search_by</a><a href="#method.binary_search_by_key">binary_search_by_key</a><a href="#method.chunks">chunks</a><a href="#method.chunks_exact">chunks_exact</a><a href="#method.chunks_exact_mut">chunks_exact_mut</a><a href="#method.chunks_mut">chunks_mut</a><a href="#method.clone_from_slice">clone_from_slice</a><a href="#method.concat">concat</a><a href="#method.connect">connect</a><a href="#method.contains">contains</a><a href="#method.copy_from_slice">copy_from_slice</a><a href="#method.copy_within">copy_within</a><a href="#method.ends_with">ends_with</a><a href="#method.eq_ignore_ascii_case">eq_ignore_ascii_case</a><a href="#method.first">first</a><a href="#method.first_mut">first_mut</a><a href="#method.get">get</a><a href="#method.get_mut">get_mut</a><a href="#method.get_unchecked">get_unchecked</a><a href="#method.get_unchecked_mut">get_unchecked_mut</a><a href="#method.is_ascii">is_ascii</a><a href="#method.is_empty-1">is_empty</a><a href="#method.is_sorted">is_sorted</a><a href="#method.is_sorted_by">is_sorted_by</a><a href="#method.is_sorted_by_key">is_sorted_by_key</a><a href="#method.iter">iter</a><a href="#method.iter_mut">iter_mut</a><a href="#method.join">join</a><a href="#method.last">last</a><a href="#method.last_mut">last_mut</a><a href="#method.len-1">len</a><a href="#method.make_ascii_lowercase">make_ascii_lowercase</a><a href="#method.make_ascii_uppercase">make_ascii_uppercase</a><a href="#method.partition_at_index">partition_at_index</a><a href="#method.partition_at_index_by">partition_at_index_by</a><a href="#method.partition_at_index_by_key">partition_at_index_by_key</a><a href="#method.partition_dedup">partition_dedup</a><a href="#method.partition_dedup_by">partition_dedup_by</a><a href="#method.partition_dedup_by_key">partition_dedup_by_key</a><a href="#method.rchunks">rchunks</a><a href="#method.rchunks_exact">rchunks_exact</a><a href="#method.rchunks_exact_mut">rchunks_exact_mut</a><a href="#method.rchunks_mut">rchunks_mut</a><a href="#method.repeat">repeat</a><a href="#method.reverse">reverse</a><a href="#method.rotate_left">rotate_left</a><a href="#method.rotate_right">rotate_right</a><a href="#method.rsplit">rsplit</a><a href="#method.rsplit_mut">rsplit_mut</a><a href="#method.rsplitn">rsplitn</a><a href="#method.rsplitn_mut">rsplitn_mut</a><a href="#method.sort">sort</a><a href="#method.sort_by">sort_by</a><a href="#method.sort_by_cached_key">sort_by_cached_key</a><a href="#method.sort_by_key">sort_by_key</a><a href="#method.sort_unstable">sort_unstable</a><a href="#method.sort_unstable_by">sort_unstable_by</a><a href="#method.sort_unstable_by_key">sort_unstable_by_key</a><a href="#method.split">split</a><a href="#method.split_at">split_at</a><a href="#method.split_at_mut">split_at_mut</a><a href="#method.split_first">split_first</a><a href="#method.split_first_mut">split_first_mut</a><a href="#method.split_inclusive">split_inclusive</a><a href="#method.split_inclusive_mut">split_inclusive_mut</a><a href="#method.split_last">split_last</a><a href="#method.split_last_mut">split_last_mut</a><a href="#method.split_mut">split_mut</a><a href="#method.splitn">splitn</a><a href="#method.splitn_mut">splitn_mut</a><a href="#method.starts_with">starts_with</a><a href="#method.swap">swap</a><a href="#method.swap_with_slice">swap_with_slice</a><a href="#method.to_ascii_lowercase">to_ascii_lowercase</a><a href="#method.to_ascii_uppercase">to_ascii_uppercase</a><a href="#method.to_vec">to_vec</a><a href="#method.windows">windows</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsRef%3C%5Bu8%5D%3E">AsRef<[u8]></a><a href="#impl-Borrow%3C%5Bu8%5D%3E">Borrow<[u8]></a><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deref">Deref</a><a href="#impl-Eq">Eq</a><a href="#impl-Extend%3C%26%27a%20u8%3E">Extend<&'a u8></a><a href="#impl-Extend%3Cu8%3E">Extend<u8></a><a href="#impl-From%3C%26%27a%20%5Bu8%5D%3E">From<&'a [u8]></a><a href="#impl-From%3C%26%27a%20str%3E">From<&'a str></a><a href="#impl-From%3CAuthority%3E">From<Authority></a><a href="#impl-From%3CByteStr%3E">From<ByteStr></a><a href="#impl-From%3CBytes%3E">From<Bytes></a><a href="#impl-From%3CBytesMut%3E">From<BytesMut></a><a href="#impl-From%3CCustom%3E">From<Custom></a><a href="#impl-From%3CHeaderName%3E">From<HeaderName></a><a href="#impl-From%3CHeaderValue%3E">From<HeaderValue></a><a href="#impl-From%3CPathAndQuery%3E">From<PathAndQuery></a><a href="#impl-From%3CScheme%3E">From<Scheme></a><a href="#impl-From%3CString%3E">From<String></a><a href="#impl-From%3CVec%3Cu8%3E%3E">From<Vec<u8>></a><a href="#impl-FromBuf">FromBuf</a><a href="#impl-FromIterator%3C%26%27a%20u8%3E">FromIterator<&'a u8></a><a href="#impl-FromIterator%3Cu8%3E">FromIterator<u8></a><a href="#impl-FromRequest">FromRequest</a><a href="#impl-Hash">Hash</a><a href="#impl-HttpTryFrom%3CBytes%3E">HttpTryFrom<Bytes></a><a href="#impl-IntoBuf">IntoBuf</a><a href="#impl-IntoHeaderValue">IntoHeaderValue</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-MessageBody">MessageBody</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3C%26%27a%20T%3E">PartialEq<&'a T></a><a href="#impl-PartialEq%3C%5Bu8%5D%3E">PartialEq<[u8]></a><a href="#impl-PartialEq%3CBytes%3E">PartialEq<Bytes></a><a href="#impl-PartialEq%3CBytesMut%3E">PartialEq<BytesMut></a><a href="#impl-PartialEq%3CString%3E">PartialEq<String></a><a href="#impl-PartialEq%3CVec%3Cu8%3E%3E">PartialEq<Vec<u8>></a><a href="#impl-PartialEq%3Cstr%3E">PartialEq<str></a><a href="#impl-PartialOrd%3C%26%27a%20T%3E">PartialOrd<&'a T></a><a href="#impl-PartialOrd%3C%5Bu8%5D%3E">PartialOrd<[u8]></a><a href="#impl-PartialOrd%3CBytes%3E">PartialOrd<Bytes></a><a href="#impl-PartialOrd%3CString%3E">PartialOrd<String></a><a href="#impl-PartialOrd%3CVec%3Cu8%3E%3E">PartialOrd<Vec<u8>></a><a href="#impl-PartialOrd%3Cstr%3E">PartialOrd<str></a><a href="#impl-Responder">Responder</a><a href="#impl-StableAsRef">StableAsRef</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoBuf">IntoBuf</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>web</a></p><script>window.sidebarCurrent = {name: 'Bytes', ty: 'struct', 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"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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'>−</span>]</a></span><a class='srclink' href='../../src/bytes/bytes.rs.html#105-107' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>web</a>::<wbr><a class="struct" href=''>Bytes</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Bytes { /* fields omitted */ }</pre></div><div class='docblock'><p>A reference counted contiguous slice of memory.</p>
|
||
<p><code>Bytes</code> is an efficient container for storing and operating on contiguous
|
||
slices of memory. It is intended for use primarily in networking code, but
|
||
could have applications elsewhere as well.</p>
|
||
<p><code>Bytes</code> values facilitate zero-copy network programming by allowing multiple
|
||
<code>Bytes</code> objects to point to the same underlying memory. This is managed by
|
||
using a reference count to track when the memory is no longer needed and can
|
||
be freed.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">mem</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"Hello world"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">mem</span>.<span class="ident">slice</span>(<span class="number">0</span>, <span class="number">5</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">a</span>[..], <span class="string">b"Hello"</span>);
|
||
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">mem</span>.<span class="ident">split_to</span>(<span class="number">6</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">mem</span>[..], <span class="string">b"world"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b"Hello "</span>);</pre></div>
|
||
<h1 id="memory-layout" class="section-header"><a href="#memory-layout">Memory layout</a></h1>
|
||
<p>The <code>Bytes</code> struct itself is fairly small, limited to a pointer to the
|
||
memory and 4 <code>usize</code> fields used to track information about which segment of
|
||
the underlying memory the <code>Bytes</code> handle has access to.</p>
|
||
<p>The memory layout looks like this:</p>
|
||
<pre><code class="language-text">+-------+
|
||
| Bytes |
|
||
+-------+
|
||
/ \_____
|
||
| \
|
||
v v
|
||
+-----+------------------------------------+
|
||
| Arc | | Data | |
|
||
+-----+------------------------------------+
|
||
</code></pre>
|
||
<p><code>Bytes</code> keeps both a pointer to the shared <code>Arc</code> containing the full memory
|
||
slice and a pointer to the start of the region visible by the handle.
|
||
<code>Bytes</code> also tracks the length of its view into the memory.</p>
|
||
<h1 id="sharing" class="section-header"><a href="#sharing">Sharing</a></h1>
|
||
<p>The memory itself is reference counted, and multiple <code>Bytes</code> objects may
|
||
point to the same region. Each <code>Bytes</code> handle point to different sections within
|
||
the memory region, and <code>Bytes</code> handle may or may not have overlapping views
|
||
into the memory.</p>
|
||
<pre><code class="language-text">
|
||
Arc ptrs +---------+
|
||
________________________ / | Bytes 2 |
|
||
/ +---------+
|
||
/ +-----------+ | |
|
||
|_________/ | Bytes 1 | | |
|
||
| +-----------+ | |
|
||
| | | ___/ data | tail
|
||
| data | tail |/ |
|
||
v v v v
|
||
+-----+---------------------------------+-----+
|
||
| Arc | | | | |
|
||
+-----+---------------------------------+-----+
|
||
</code></pre>
|
||
<h1 id="mutating" class="section-header"><a href="#mutating">Mutating</a></h1>
|
||
<p>While <code>Bytes</code> handles may potentially represent overlapping views of the
|
||
underlying memory slice and may not be mutated, <code>BytesMut</code> handles are
|
||
guaranteed to be the only handle able to view that slice of memory. As such,
|
||
<code>BytesMut</code> handles are able to mutate the underlying memory. Note that
|
||
holding a unique view to a region of memory does not mean that there are no
|
||
other <code>Bytes</code> and <code>BytesMut</code> handles with disjoint views of the underlying
|
||
memory.</p>
|
||
<h1 id="inline-bytes" class="section-header"><a href="#inline-bytes">Inline bytes</a></h1>
|
||
<p>As an optimization, when the slice referenced by a <code>Bytes</code> or <code>BytesMut</code>
|
||
handle is small enough <sup id="fnref1"><a href="#fn1">1</a></sup>, <code>with_capacity</code> will avoid the allocation by
|
||
inlining the slice directly in the handle. In this case, a clone is no
|
||
longer "shallow" and the data will be copied. Converting from a <code>Vec</code> will
|
||
never use inlining.</p>
|
||
<div class="footnotes"><hr><ol><li id="fn1"><p>Small enough: 31 bytes on 64 bit systems, 15 on 32 bit systems. <a href="#fnref1" rev="footnote">↩</a></p></li></ol></div></div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#390-835' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.with_capacity' class="method"><code id='with_capacity.v'>pub fn <a href='#method.with_capacity' class='fnname'>with_capacity</a>(capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#415-419' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new <code>Bytes</code> with the specified capacity.</p>
|
||
<p>The returned <code>Bytes</code> will be able to hold at least <code>capacity</code> bytes
|
||
without reallocating. If <code>capacity</code> is under <code>4 * size_of::<usize>() - 1</code>,
|
||
then <code>BytesMut</code> will not allocate.</p>
|
||
<p>It is important to note that this function does not specify the length
|
||
of the returned <code>Bytes</code>, but only the capacity.</p>
|
||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">with_capacity</span>(<span class="number">64</span>);
|
||
|
||
<span class="comment">// `bytes` contains no data, even though there is capacity</span>
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">bytes</span>.<span class="ident">len</span>(), <span class="number">0</span>);
|
||
|
||
<span class="ident">bytes</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">bytes</span>[..], <span class="string">b"hello world"</span>);</pre></div>
|
||
</div><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#434-436' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new empty <code>Bytes</code>.</p>
|
||
<p>This will not allocate and the returned <code>Bytes</code> handle will be empty.</p>
|
||
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">new</span>();
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b""</span>);</pre></div>
|
||
</div><h4 id='method.from_static' class="method"><code id='from_static.v'>pub fn <a href='#method.from_static' class='fnname'>from_static</a>(bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'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>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#452-456' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new <code>Bytes</code> from a static slice.</p>
|
||
<p>The returned <code>Bytes</code> will point directly to the static slice. There is
|
||
no allocating or copying.</p>
|
||
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from_static</span>(<span class="string">b"hello"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b"hello"</span>);</pre></div>
|
||
</div><h4 id='method.len' class="method"><code id='len.v'>pub fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#469-471' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the number of bytes contained in this <code>Bytes</code>.</p>
|
||
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"hello"</span>[..]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">len</span>(), <span class="number">5</span>);</pre></div>
|
||
</div><h4 id='method.is_empty' class="method"><code id='is_empty.v'>pub fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#484-486' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns true if the <code>Bytes</code> has a length of 0.</p>
|
||
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">new</span>();
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">is_empty</span>());</pre></div>
|
||
</div><h4 id='method.slice' class="method"><code id='slice.v'>pub fn <a href='#method.slice' class='fnname'>slice</a>(&self, begin: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, end: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#510-526' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a slice of self for the index range <code>[begin..end)</code>.</p>
|
||
<p>This will increment the reference count for the underlying memory and
|
||
return a new <code>Bytes</code> handle set to the slice.</p>
|
||
<p>This operation is <code>O(1)</code>.</p>
|
||
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">slice</span>(<span class="number">2</span>, <span class="number">5</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b"llo"</span>);</pre></div>
|
||
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
|
||
<p>Requires that <code>begin <= end</code> and <code>end <= self.len()</code>, otherwise slicing
|
||
will panic.</p>
|
||
</div><h4 id='method.slice_from' class="method"><code id='slice_from.v'>pub fn <a href='#method.slice_from' class='fnname'>slice_from</a>(&self, begin: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#550-552' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a slice of self for the index range <code>[begin..self.len())</code>.</p>
|
||
<p>This will increment the reference count for the underlying memory and
|
||
return a new <code>Bytes</code> handle set to the slice.</p>
|
||
<p>This operation is <code>O(1)</code> and is equivalent to <code>self.slice(begin, self.len())</code>.</p>
|
||
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">slice_from</span>(<span class="number">6</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b"world"</span>);</pre></div>
|
||
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
|
||
<p>Requires that <code>begin <= self.len()</code>, otherwise slicing will panic.</p>
|
||
</div><h4 id='method.slice_to' class="method"><code id='slice_to.v'>pub fn <a href='#method.slice_to' class='fnname'>slice_to</a>(&self, end: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#575-577' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a slice of self for the index range <code>[0..end)</code>.</p>
|
||
<p>This will increment the reference count for the underlying memory and
|
||
return a new <code>Bytes</code> handle set to the slice.</p>
|
||
<p>This operation is <code>O(1)</code> and is equivalent to <code>self.slice(0, end)</code>.</p>
|
||
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">slice_to</span>(<span class="number">5</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b"hello"</span>);</pre></div>
|
||
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
|
||
<p>Requires that <code>end <= self.len()</code>, otherwise slicing will panic.</p>
|
||
</div><h4 id='method.slice_ref' class="method"><code id='slice_ref.v'>pub fn <a href='#method.slice_ref' class='fnname'>slice_ref</a>(&self, subset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#604-617' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a slice of self that is equivalent to the given <code>subset</code>.</p>
|
||
<p>When processing a <code>Bytes</code> buffer with other tools, one often gets a
|
||
<code>&[u8]</code> which is in fact a slice of the <code>Bytes</code>, i.e. a subset of it.
|
||
This function turns that <code>&[u8]</code> into another <code>Bytes</code>, as if one had
|
||
called <code>self.slice()</code> with the offsets that correspond to <code>subset</code>.</p>
|
||
<p>This operation is <code>O(1)</code>.</p>
|
||
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"012345678"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">as_slice</span> <span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">as_ref</span>();
|
||
<span class="kw">let</span> <span class="ident">subset</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">as_slice</span>[<span class="number">2</span>..<span class="number">6</span>];
|
||
<span class="kw">let</span> <span class="ident">subslice</span> <span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">slice_ref</span>(<span class="kw-2">&</span><span class="ident">subset</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">subslice</span>[..], <span class="string">b"2345"</span>);</pre></div>
|
||
<h1 id="panics-3" class="section-header"><a href="#panics-3">Panics</a></h1>
|
||
<p>Requires that the given <code>sub</code> slice is in fact contained within the
|
||
<code>Bytes</code> buffer; otherwise this function will panic.</p>
|
||
</div><h4 id='method.split_off' class="method"><code id='split_off.v'>pub fn <a href='#method.split_off' class='fnname'>split_off</a>(&mut self, at: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#642-656' title='goto source code'>[src]</a></h4><div class='docblock'><p>Splits the bytes into two at the given index.</p>
|
||
<p>Afterwards <code>self</code> contains elements <code>[0, at)</code>, and the returned <code>Bytes</code>
|
||
contains elements <code>[at, len)</code>.</p>
|
||
<p>This is an <code>O(1)</code> operation that just increases the reference count and
|
||
sets a few indices.</p>
|
||
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">split_off</span>(<span class="number">5</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">a</span>[..], <span class="string">b"hello"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b" world"</span>);</pre></div>
|
||
<h1 id="panics-4" class="section-header"><a href="#panics-4">Panics</a></h1>
|
||
<p>Panics if <code>at > len</code>.</p>
|
||
</div><h4 id='method.split_to' class="method"><code id='split_to.v'>pub fn <a href='#method.split_to' class='fnname'>split_to</a>(&mut self, at: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#681-695' title='goto source code'>[src]</a></h4><div class='docblock'><p>Splits the bytes into two at the given index.</p>
|
||
<p>Afterwards <code>self</code> contains elements <code>[at, len)</code>, and the returned
|
||
<code>Bytes</code> contains elements <code>[0, at)</code>.</p>
|
||
<p>This is an <code>O(1)</code> operation that just increases the reference count and
|
||
sets a few indices.</p>
|
||
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">split_to</span>(<span class="number">5</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">a</span>[..], <span class="string">b" world"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">b</span>[..], <span class="string">b"hello"</span>);</pre></div>
|
||
<h1 id="panics-5" class="section-header"><a href="#panics-5">Panics</a></h1>
|
||
<p>Panics if <code>at > len</code>.</p>
|
||
</div><h4 id='method.truncate' class="method"><code id='truncate.v'>pub fn <a href='#method.truncate' class='fnname'>truncate</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code><a class='srclink' href='../../src/bytes/bytes.rs.html#723-725' title='goto source code'>[src]</a></h4><div class='docblock'><p>Shortens the buffer, keeping the first <code>len</code> bytes and dropping the
|
||
rest.</p>
|
||
<p>If <code>len</code> is greater than the buffer's current length, this has no
|
||
effect.</p>
|
||
<p>The <a href="#method.split_off"><code>split_off</code></a> method can emulate <code>truncate</code>, but this causes the
|
||
excess bytes to be returned instead of dropped.</p>
|
||
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</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">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="ident">buf</span>.<span class="ident">truncate</span>(<span class="number">5</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">buf</span>, <span class="string">b"hello"</span>[..]);</pre></div>
|
||
</div><h4 id='method.advance' class="method"><code id='advance.v'>pub fn <a href='#method.advance' class='fnname'>advance</a>(&mut self, cnt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code><a class='srclink' href='../../src/bytes/bytes.rs.html#738-741' title='goto source code'>[src]</a></h4><div class='docblock'><p>Shortens the buffer, dropping the first <code>cnt</code> bytes and keeping the
|
||
rest.</p>
|
||
<p>This is the same function as <code>Buf::advance</code>, and in the next breaking
|
||
release of <code>bytes</code>, this implementation will be removed in favor of
|
||
having <code>Bytes</code> implement <code>Buf</code>.</p>
|
||
<h1 id="panics-6" class="section-header"><a href="#panics-6">Panics</a></h1>
|
||
<p>This function panics if <code>cnt</code> is greater than <code>self.len()</code></p>
|
||
</div><h4 id='method.clear' class="method"><code id='clear.v'>pub fn <a href='#method.clear' class='fnname'>clear</a>(&mut self)</code><a class='srclink' href='../../src/bytes/bytes.rs.html#754-756' title='goto source code'>[src]</a></h4><div class='docblock'><p>Clears the buffer, removing all data.</p>
|
||
<h1 id="examples-12" class="section-header"><a href="#examples-12">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</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">from</span>(<span class="kw-2">&</span><span class="string">b"hello world"</span>[..]);
|
||
<span class="ident">buf</span>.<span class="ident">clear</span>();
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">buf</span>.<span class="ident">is_empty</span>());</pre></div>
|
||
</div><h4 id='method.try_mut' class="method"><code id='try_mut.v'>pub fn <a href='#method.try_mut' class='fnname'>try_mut</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a>, <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#786-792' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to convert into a <code>BytesMut</code> handle.</p>
|
||
<p>This will only succeed if there are no other outstanding references to
|
||
the underlying chunk of memory. <code>Bytes</code> handles that contain inlined
|
||
bytes will always be convertable to <code>BytesMut</code>.</p>
|
||
<h1 id="examples-13" class="section-header"><a href="#examples-13">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Bytes</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="string">b"Mary had a little lamb, little lamb, little lamb..."</span>[..]);
|
||
|
||
<span class="comment">// Create a shallow clone</span>
|
||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">clone</span>();
|
||
|
||
<span class="comment">// This will fail because `b` shares a reference with `a`</span>
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">try_mut</span>().<span class="ident">unwrap_err</span>();
|
||
|
||
<span class="ident">drop</span>(<span class="ident">b</span>);
|
||
|
||
<span class="comment">// This will succeed</span>
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">try_mut</span>().<span class="ident">unwrap</span>();
|
||
|
||
<span class="ident">a</span>[<span class="number">0</span>] <span class="op">=</span> <span class="string">b'b'</span>;
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">a</span>[..<span class="number">4</span>], <span class="string">b"bary"</span>);</pre></div>
|
||
</div><h4 id='method.extend_from_slice' class="method"><code id='extend_from_slice.v'>pub fn <a href='#method.extend_from_slice' class='fnname'>extend_from_slice</a>(&mut self, extend: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>)</code><a class='srclink' href='../../src/bytes/bytes.rs.html#813-834' title='goto source code'>[src]</a></h4><div class='docblock'><p>Appends given bytes to this object.</p>
|
||
<p>If this <code>Bytes</code> object has not enough capacity, it is resized first.
|
||
If it is shared (<code>refcount > 1</code>), it is copied first.</p>
|
||
<p>This operation can be less effective than the similar operation on
|
||
<code>BytesMut</code>, especially on small additions.</p>
|
||
<h1 id="examples-14" class="section-header"><a href="#examples-14">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</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">from</span>(<span class="string">"aabb"</span>);
|
||
<span class="ident">buf</span>.<span class="ident">extend_from_slice</span>(<span class="string">b"ccdd"</span>);
|
||
<span class="ident">buf</span>.<span class="ident">extend_from_slice</span>(<span class="string">b"eeff"</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">b"aabbccddeeff"</span>, <span class="kw-2">&</span><span class="ident">buf</span>[..]);</pre></div>
|
||
</div></div><h2 id='deref-methods' class='small-section-header'>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>><a href='#deref-methods' class='anchor'></a></h2><div class='impl-items'><h4 id='method.len-1' class="method"><code id='len.v-1'>pub const fn <a href='#method.len-1' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#73-75' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the number of elements in the slice.</p>
|
||
<h1 id="examples-15" class="section-header"><a href="#examples-15">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">3</span>);</pre></div>
|
||
</div><h4 id='method.is_empty-1' class="method"><code id='is_empty.v-1'>pub const fn <a href='#method.is_empty-1' class='fnname'>is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#88-90' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the slice has a length of 0.</p>
|
||
<h1 id="examples-16" class="section-header"><a href="#examples-16">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_empty</span>());</pre></div>
|
||
</div><h4 id='method.first' class="method"><code id='first.v'>pub fn <a href='#method.first' class='fnname'>first</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#105-107' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the first element of the slice, or <code>None</code> if it is empty.</p>
|
||
<h1 id="examples-17" class="section-header"><a href="#examples-17">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">10</span>), <span class="ident">v</span>.<span class="ident">first</span>());
|
||
|
||
<span class="kw">let</span> <span class="ident">w</span>: <span class="kw-2">&</span>[<span class="ident">i32</span>] <span class="op">=</span> <span class="kw-2">&</span>[];
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">w</span>.<span class="ident">first</span>());</pre></div>
|
||
</div><h4 id='method.split_first' class="method"><code id='split_first.v'>pub fn <a href='#method.split_first' class='fnname'>split_first</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><span class='since' title='Stable since Rust version 1.5.0'>1.5.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#141-143' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the first and all the rest of the elements of the slice, or <code>None</code> if it is empty.</p>
|
||
<h1 id="examples-18" class="section-header"><a href="#examples-18">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>];
|
||
|
||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">first</span>, <span class="ident">elements</span>)) <span class="op">=</span> <span class="ident">x</span>.<span class="ident">split_first</span>() {
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">first</span>, <span class="kw-2">&</span><span class="number">0</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">elements</span>, <span class="kw-2">&</span>[<span class="number">1</span>, <span class="number">2</span>]);
|
||
}</pre></div>
|
||
</div><h4 id='method.split_last' class="method"><code id='split_last.v'>pub fn <a href='#method.split_last' class='fnname'>split_last</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><span class='since' title='Stable since Rust version 1.5.0'>1.5.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#179-181' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the last and all the rest of the elements of the slice, or <code>None</code> if it is empty.</p>
|
||
<h1 id="examples-19" class="section-header"><a href="#examples-19">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>];
|
||
|
||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">last</span>, <span class="ident">elements</span>)) <span class="op">=</span> <span class="ident">x</span>.<span class="ident">split_last</span>() {
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">last</span>, <span class="kw-2">&</span><span class="number">2</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">elements</span>, <span class="kw-2">&</span>[<span class="number">0</span>, <span class="number">1</span>]);
|
||
}</pre></div>
|
||
</div><h4 id='method.last' class="method"><code id='last.v'>pub fn <a href='#method.last' class='fnname'>last</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the last element of the slice, or <code>None</code> if it is empty.</p>
|
||
<h1 id="examples-20" class="section-header"><a href="#examples-20">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">30</span>), <span class="ident">v</span>.<span class="ident">last</span>());
|
||
|
||
<span class="kw">let</span> <span class="ident">w</span>: <span class="kw-2">&</span>[<span class="ident">i32</span>] <span class="op">=</span> <span class="kw-2">&</span>[];
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">w</span>.<span class="ident">last</span>());</pre></div>
|
||
</div><h4 id='method.get' class="method"><code id='get.v'>pub fn <a href='#method.get' class='fnname'>get</a><I>(&self, index: I) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/trait.SliceIndex.html" title="trait core::slice::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/slice/trait.SliceIndex.html#associatedtype.Output" title="type core::slice::SliceIndex::Output">Output</a>> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/trait.SliceIndex.html" title="trait core::slice::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#257-262' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to an element or subslice depending on the type of
|
||
index.</p>
|
||
<ul>
|
||
<li>If given a position, returns a reference to the element at that
|
||
position or <code>None</code> if out of bounds.</li>
|
||
<li>If given a range, returns the subslice corresponding to that range,
|
||
or <code>None</code> if out of bounds.</li>
|
||
</ul>
|
||
<h1 id="examples-21" class="section-header"><a href="#examples-21">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">40</span>), <span class="ident">v</span>.<span class="ident">get</span>(<span class="number">1</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>][..]), <span class="ident">v</span>.<span class="ident">get</span>(<span class="number">0</span>..<span class="number">2</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">v</span>.<span class="ident">get</span>(<span class="number">3</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">v</span>.<span class="ident">get</span>(<span class="number">0</span>..<span class="number">4</span>));</pre></div>
|
||
</div><h4 id='method.get_unchecked' class="method"><code id='get_unchecked.v'>pub unsafe fn <a href='#method.get_unchecked' class='fnname'>get_unchecked</a><I>(<br> &self, <br> index: I<br>) -> &<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/trait.SliceIndex.html" title="trait core::slice::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/slice/trait.SliceIndex.html#associatedtype.Output" title="type core::slice::SliceIndex::Output">Output</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/trait.SliceIndex.html" title="trait core::slice::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#310-315' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to an element or subslice, without doing bounds
|
||
checking.</p>
|
||
<p>This is generally not recommended, use with caution!
|
||
Calling this method with an out-of-bounds index is <em><a href="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>
|
||
even if the resulting reference is not used.
|
||
For a safe alternative see <a href="#method.get"><code>get</code></a>.</p>
|
||
<h1 id="examples-22" class="section-header"><a href="#examples-22">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">4</span>];
|
||
|
||
<span class="kw">unsafe</span> {
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">get_unchecked</span>(<span class="number">1</span>), <span class="kw-2">&</span><span class="number">2</span>);
|
||
}</pre></div>
|
||
</div><h4 id='method.as_ptr' class="method"><code id='as_ptr.v'>pub const fn <a href='#method.as_ptr' class='fnname'>as_ptr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#377-379' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a raw pointer to the slice's buffer.</p>
|
||
<p>The caller must ensure that the slice outlives the pointer this
|
||
function returns, or else it will end up pointing to garbage.</p>
|
||
<p>The caller must also ensure that the memory the pointer (non-transitively) points to
|
||
is never written to (except inside an <code>UnsafeCell</code>) using this pointer or any pointer
|
||
derived from it. If you need to mutate the contents of the slice, use <a href="#method.as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
|
||
<p>Modifying the container referenced by this slice may cause its buffer
|
||
to be reallocated, which would also make any pointers to it invalid.</p>
|
||
<h1 id="examples-23" class="section-header"><a href="#examples-23">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">4</span>];
|
||
<span class="kw">let</span> <span class="ident">x_ptr</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">as_ptr</span>();
|
||
|
||
<span class="kw">unsafe</span> {
|
||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">x</span>.<span class="ident">len</span>() {
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">get_unchecked</span>(<span class="ident">i</span>), <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">x_ptr</span>.<span class="ident">add</span>(<span class="ident">i</span>));
|
||
}
|
||
}</pre></div>
|
||
</div><h4 id='method.as_ptr_range' class="method"><code id='as_ptr_range.v'>pub fn <a href='#method.as_ptr_range' class='fnname'>as_ptr_range</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#440-461' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>slice_ptr_range</code>)</div></div><div class='docblock'><p>Returns the two raw pointers spanning the slice.</p>
|
||
<p>The returned range is half-open, which means that the end pointer
|
||
points <em>one past</em> the last element of the slice. This way, an empty
|
||
slice is represented by two equal pointers, and the difference between
|
||
the two pointers represents the size of the size.</p>
|
||
<p>See <a href="#method.as_ptr"><code>as_ptr</code></a> for warnings on using these pointers. The end pointer
|
||
requires extra caution, as it does not point to a valid element in the
|
||
slice.</p>
|
||
<p>This function is useful for interacting with foreign interfaces which
|
||
use two pointers to refer to a range of elements in memory, as is
|
||
common in C++.</p>
|
||
<p>It can also be useful to check if a pointer to an element refers to an
|
||
element of this slice:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">slice_ptr_range</span>)]</span>
|
||
|
||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">a</span>[<span class="number">1</span>] <span class="kw">as</span> <span class="kw-2">*</span><span class="kw">const</span> <span class="kw">_</span>;
|
||
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="kw-2">&</span><span class="number">5</span> <span class="kw">as</span> <span class="kw-2">*</span><span class="kw">const</span> <span class="kw">_</span>;
|
||
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">as_ptr_range</span>().<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">x</span>));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">as_ptr_range</span>().<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">y</span>));</pre></div>
|
||
</div><h4 id='method.iter' class="method"><code id='iter.v'>pub fn <a href='#method.iter' class='fnname'>iter</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.Iter.html" title="struct core::slice::Iter">Iter</a><T></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#606-619' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over the slice.</p>
|
||
<h1 id="examples-24" class="section-header"><a href="#examples-24">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">4</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">iter</span>();
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iterator</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">1</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iterator</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">2</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iterator</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">4</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iterator</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>);</pre></div>
|
||
</div><h4 id='method.windows' class="method"><code id='windows.v'>pub fn <a href='#method.windows' class='fnname'>windows</a>(&self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.Windows.html" title="struct core::slice::Windows">Windows</a><T></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#677-680' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over all contiguous windows of length
|
||
<code>size</code>. The windows overlap. If the slice is shorter than
|
||
<code>size</code>, the iterator returns no values.</p>
|
||
<h1 id="panics-7" class="section-header"><a href="#panics-7">Panics</a></h1>
|
||
<p>Panics if <code>size</code> is 0.</p>
|
||
<h1 id="examples-25" class="section-header"><a href="#examples-25">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="string">'r'</span>, <span class="string">'u'</span>, <span class="string">'s'</span>, <span class="string">'t'</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">windows</span>(<span class="number">2</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'r'</span>, <span class="string">'u'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'u'</span>, <span class="string">'s'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'s'</span>, <span class="string">'t'</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
<p>If the slice is shorter than <code>size</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="string">'f'</span>, <span class="string">'o'</span>, <span class="string">'o'</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">windows</span>(<span class="number">4</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
</div><h4 id='method.chunks' class="method"><code id='chunks.v'>pub fn <a href='#method.chunks' class='fnname'>chunks</a>(&self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.Chunks.html" title="struct core::slice::Chunks">Chunks</a><T></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#711-714' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
|
||
beginning of the slice.</p>
|
||
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
|
||
slice, then the last chunk will not have length <code>chunk_size</code>.</p>
|
||
<p>See <a href="#method.chunks_exact"><code>chunks_exact</code></a> for a variant of this iterator that returns chunks of always exactly
|
||
<code>chunk_size</code> elements, and <a href="#method.rchunks"><code>rchunks</code></a> for the same iterator but starting at the end of the
|
||
slice.</p>
|
||
<h1 id="panics-8" class="section-header"><a href="#panics-8">Panics</a></h1>
|
||
<p>Panics if <code>chunk_size</code> is 0.</p>
|
||
<h1 id="examples-26" class="section-header"><a href="#examples-26">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="string">'l'</span>, <span class="string">'o'</span>, <span class="string">'r'</span>, <span class="string">'e'</span>, <span class="string">'m'</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">chunks</span>(<span class="number">2</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'l'</span>, <span class="string">'o'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'r'</span>, <span class="string">'e'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'m'</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
</div><h4 id='method.chunks_exact' class="method"><code id='chunks_exact.v'>pub fn <a href='#method.chunks_exact' class='fnname'>chunks_exact</a>(&self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.ChunksExact.html" title="struct core::slice::ChunksExact">ChunksExact</a><T></code><span class='since' title='Stable since Rust version 1.31.0'>1.31.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#786-792' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
|
||
beginning of the slice.</p>
|
||
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
|
||
slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be retrieved
|
||
from the <code>remainder</code> function of the iterator.</p>
|
||
<p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
|
||
resulting code better than in the case of <a href="#method.chunks"><code>chunks</code></a>.</p>
|
||
<p>See <a href="#method.chunks"><code>chunks</code></a> for a variant of this iterator that also returns the remainder as a smaller
|
||
chunk, and <a href="#method.rchunks_exact"><code>rchunks_exact</code></a> for the same iterator but starting at the end of the slice.</p>
|
||
<h1 id="panics-9" class="section-header"><a href="#panics-9">Panics</a></h1>
|
||
<p>Panics if <code>chunk_size</code> is 0.</p>
|
||
<h1 id="examples-27" class="section-header"><a href="#examples-27">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="string">'l'</span>, <span class="string">'o'</span>, <span class="string">'r'</span>, <span class="string">'e'</span>, <span class="string">'m'</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">chunks_exact</span>(<span class="number">2</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'l'</span>, <span class="string">'o'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'r'</span>, <span class="string">'e'</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">remainder</span>(), <span class="kw-2">&</span>[<span class="string">'m'</span>]);</pre></div>
|
||
</div><h4 id='method.rchunks' class="method"><code id='rchunks.v'>pub fn <a href='#method.rchunks' class='fnname'>rchunks</a>(&self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.RChunks.html" title="struct core::slice::RChunks">RChunks</a><T></code><span class='since' title='Stable since Rust version 1.31.0'>1.31.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#868-871' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the end
|
||
of the slice.</p>
|
||
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
|
||
slice, then the last chunk will not have length <code>chunk_size</code>.</p>
|
||
<p>See <a href="#method.rchunks_exact"><code>rchunks_exact</code></a> for a variant of this iterator that returns chunks of always exactly
|
||
<code>chunk_size</code> elements, and <a href="#method.chunks"><code>chunks</code></a> for the same iterator but starting at the beginning
|
||
of the slice.</p>
|
||
<h1 id="panics-10" class="section-header"><a href="#panics-10">Panics</a></h1>
|
||
<p>Panics if <code>chunk_size</code> is 0.</p>
|
||
<h1 id="examples-28" class="section-header"><a href="#examples-28">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="string">'l'</span>, <span class="string">'o'</span>, <span class="string">'r'</span>, <span class="string">'e'</span>, <span class="string">'m'</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">rchunks</span>(<span class="number">2</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'e'</span>, <span class="string">'m'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'o'</span>, <span class="string">'r'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'l'</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
</div><h4 id='method.rchunks_exact' class="method"><code id='rchunks_exact.v'>pub fn <a href='#method.rchunks_exact' class='fnname'>rchunks_exact</a>(&self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.RChunksExact.html" title="struct core::slice::RChunksExact">RChunksExact</a><T></code><span class='since' title='Stable since Rust version 1.31.0'>1.31.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#945-950' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
|
||
end of the slice.</p>
|
||
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
|
||
slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be retrieved
|
||
from the <code>remainder</code> function of the iterator.</p>
|
||
<p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
|
||
resulting code better than in the case of <a href="#method.chunks"><code>chunks</code></a>.</p>
|
||
<p>See <a href="#method.rchunks"><code>rchunks</code></a> for a variant of this iterator that also returns the remainder as a smaller
|
||
chunk, and <a href="#method.chunks_exact"><code>chunks_exact</code></a> for the same iterator but starting at the beginning of the
|
||
slice.</p>
|
||
<h1 id="panics-11" class="section-header"><a href="#panics-11">Panics</a></h1>
|
||
<p>Panics if <code>chunk_size</code> is 0.</p>
|
||
<h1 id="examples-29" class="section-header"><a href="#examples-29">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="string">'l'</span>, <span class="string">'o'</span>, <span class="string">'r'</span>, <span class="string">'e'</span>, <span class="string">'m'</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">rchunks_exact</span>(<span class="number">2</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'e'</span>, <span class="string">'m'</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="string">'o'</span>, <span class="string">'r'</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">remainder</span>(), <span class="kw-2">&</span>[<span class="string">'l'</span>]);</pre></div>
|
||
</div><h4 id='method.split_at' class="method"><code id='split_at.v'>pub fn <a href='#method.split_at' class='fnname'>split_at</a>(&self, mid: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1032-1034' title='goto source code'>[src]</a></h4><div class='docblock'><p>Divides one slice into two at an index.</p>
|
||
<p>The first will contain all indices from <code>[0, mid)</code> (excluding
|
||
the index <code>mid</code> itself) and the second will contain all
|
||
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
|
||
<h1 id="panics-12" class="section-header"><a href="#panics-12">Panics</a></h1>
|
||
<p>Panics if <code>mid > len</code>.</p>
|
||
<h1 id="examples-30" class="section-header"><a href="#examples-30">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>];
|
||
|
||
{
|
||
<span class="kw">let</span> (<span class="ident">left</span>, <span class="ident">right</span>) <span class="op">=</span> <span class="ident">v</span>.<span class="ident">split_at</span>(<span class="number">0</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">left</span> <span class="op">=</span><span class="op">=</span> []);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">right</span> <span class="op">=</span><span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>]);
|
||
}
|
||
|
||
{
|
||
<span class="kw">let</span> (<span class="ident">left</span>, <span class="ident">right</span>) <span class="op">=</span> <span class="ident">v</span>.<span class="ident">split_at</span>(<span class="number">2</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">left</span> <span class="op">=</span><span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">right</span> <span class="op">=</span><span class="op">=</span> [<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>]);
|
||
}
|
||
|
||
{
|
||
<span class="kw">let</span> (<span class="ident">left</span>, <span class="ident">right</span>) <span class="op">=</span> <span class="ident">v</span>.<span class="ident">split_at</span>(<span class="number">6</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">left</span> <span class="op">=</span><span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">right</span> <span class="op">=</span><span class="op">=</span> []);
|
||
}</pre></div>
|
||
</div><h4 id='method.split' class="method"><code id='split.v'>pub fn <a href='#method.split' class='fnname'>split</a><F>(&self, pred: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.Split.html" title="struct core::slice::Split">Split</a><T, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1115-1120' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over subslices separated by elements that match
|
||
<code>pred</code>. The matched element is not contained in the subslices.</p>
|
||
<h1 id="examples-31" class="section-header"><a href="#examples-31">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>, <span class="number">20</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">split</span>(<span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">20</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
<p>If the first element is matched, an empty slice will be the first item
|
||
returned by the iterator. Similarly, if the last element in the slice
|
||
is matched, an empty slice will be the last item returned by the
|
||
iterator:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">split</span>(<span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
<p>If two matched elements are directly adjacent, an empty slice will be
|
||
present between them:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">6</span>, <span class="number">33</span>, <span class="number">20</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">split</span>(<span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">10</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">20</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
</div><h4 id='method.split_inclusive' class="method"><code id='split_inclusive.v'>pub fn <a href='#method.split_inclusive' class='fnname'>split_inclusive</a><F>(&self, pred: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.SplitInclusive.html" title="struct core::slice::SplitInclusive">SplitInclusive</a><T, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, </span></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1175-1180' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>split_inclusive</code>)</div></div><div class='docblock'><p>Returns an iterator over subslices separated by elements that match
|
||
<code>pred</code>. The matched element is contained in the end of the previous
|
||
subslice as a terminator.</p>
|
||
<h1 id="examples-32" class="section-header"><a href="#examples-32">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">split_inclusive</span>)]</span>
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>, <span class="number">20</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">split_inclusive</span>(<span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">20</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
<p>If the last element of the slice is matched,
|
||
that element will be considered the terminator of the preceding slice.
|
||
That slice will be the last item returned by the iterator.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">split_inclusive</span>)]</span>
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="number">3</span>, <span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">split_inclusive</span>(<span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">3</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>]);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre></div>
|
||
</div><h4 id='method.rsplit' class="method"><code id='rsplit.v'>pub fn <a href='#method.rsplit' class='fnname'>rsplit</a><F>(&self, pred: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.RSplit.html" title="struct core::slice::RSplit">RSplit</a><T, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, </span></code><span class='since' title='Stable since Rust version 1.27.0'>1.27.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1236-1241' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over subslices separated by elements that match
|
||
<code>pred</code>, starting at the end of the slice and working backwards.
|
||
The matched element is not contained in the subslices.</p>
|
||
<h1 id="examples-33" class="section-header"><a href="#examples-33">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">slice</span> <span class="op">=</span> [<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>, <span class="number">0</span>, <span class="number">44</span>, <span class="number">55</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">slice</span>.<span class="ident">rsplit</span>(<span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">num</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">44</span>, <span class="number">55</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>);</pre></div>
|
||
<p>As with <code>split()</code>, if the first or last element is matched, an empty
|
||
slice will be the first (or last) item returned by the iterator.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>];
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">it</span> <span class="op">=</span> <span class="ident">v</span>.<span class="ident">rsplit</span>(<span class="op">|</span><span class="ident">n</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">n</span> <span class="op">%</span> <span class="number">2</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">3</span>, <span class="number">5</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[<span class="number">1</span>, <span class="number">1</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span>[]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>);</pre></div>
|
||
</div><h4 id='method.splitn' class="method"><code id='splitn.v'>pub fn <a href='#method.splitn' class='fnname'>splitn</a><F>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pred: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.SplitN.html" title="struct core::slice::SplitN">SplitN</a><T, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1290-1295' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over subslices separated by elements that match
|
||
<code>pred</code>, limited to returning at most <code>n</code> items. The matched element is
|
||
not contained in the subslices.</p>
|
||
<p>The last element returned, if any, will contain the remainder of the
|
||
slice.</p>
|
||
<h1 id="examples-34" class="section-header"><a href="#examples-34">Examples</a></h1>
|
||
<p>Print the slice split once by numbers divisible by 3 (i.e., <code>[10, 40]</code>,
|
||
<code>[20, 60, 50]</code>):</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>, <span class="number">20</span>, <span class="number">60</span>, <span class="number">50</span>];
|
||
|
||
<span class="kw">for</span> <span class="ident">group</span> <span class="kw">in</span> <span class="ident">v</span>.<span class="ident">splitn</span>(<span class="number">2</span>, <span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>) {
|
||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{:?}"</span>, <span class="ident">group</span>);
|
||
}</pre></div>
|
||
</div><h4 id='method.rsplitn' class="method"><code id='rsplitn.v'>pub fn <a href='#method.rsplitn' class='fnname'>rsplitn</a><F>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pred: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/struct.RSplitN.html" title="struct core::slice::RSplitN">RSplitN</a><T, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1345-1350' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over subslices separated by elements that match
|
||
<code>pred</code> limited to returning at most <code>n</code> items. This starts at the end of
|
||
the slice and works backwards. The matched element is not contained in
|
||
the subslices.</p>
|
||
<p>The last element returned, if any, will contain the remainder of the
|
||
slice.</p>
|
||
<h1 id="examples-35" class="section-header"><a href="#examples-35">Examples</a></h1>
|
||
<p>Print the slice split once, starting from the end, by numbers divisible
|
||
by 3 (i.e., <code>[50]</code>, <code>[10, 40, 30, 20]</code>):</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>, <span class="number">20</span>, <span class="number">60</span>, <span class="number">50</span>];
|
||
|
||
<span class="kw">for</span> <span class="ident">group</span> <span class="kw">in</span> <span class="ident">v</span>.<span class="ident">rsplitn</span>(<span class="number">2</span>, <span class="op">|</span><span class="ident">num</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">num</span> <span class="op">%</span> <span class="number">3</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span>) {
|
||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{:?}"</span>, <span class="ident">group</span>);
|
||
}</pre></div>
|
||
</div><h4 id='method.contains' class="method"><code id='contains.v'>pub fn <a href='#method.contains' class='fnname'>contains</a>(&self, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><T>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1398-1403' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the slice contains an element with the given value.</p>
|
||
<h1 id="examples-36" class="section-header"><a href="#examples-36">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="number">30</span>));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="number">50</span>));</pre></div>
|
||
<p>If you do not have an <code>&T</code>, but just an <code>&U</code> such that <code>T: Borrow<U></code>
|
||
(e.g. <code>String: Borrow<str></code>), you can use <code>iter().any</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="ident">String</span>::<span class="ident">from</span>(<span class="string">"hello"</span>), <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">"world"</span>)]; <span class="comment">// slice of `String`</span>
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">iter</span>().<span class="ident">any</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="ident">e</span> <span class="op">=</span><span class="op">=</span> <span class="string">"hello"</span>)); <span class="comment">// search with `&str`</span>
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">iter</span>().<span class="ident">any</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="ident">e</span> <span class="op">=</span><span class="op">=</span> <span class="string">"hi"</span>));</pre></div>
|
||
</div><h4 id='method.starts_with' class="method"><code id='starts_with.v'>pub fn <a href='#method.starts_with' class='fnname'>starts_with</a>(&self, needle: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><T>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1426-1432' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if <code>needle</code> is a prefix of the slice.</p>
|
||
<h1 id="examples-37" class="section-header"><a href="#examples-37">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span>[<span class="number">10</span>]));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>]));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span>[<span class="number">50</span>]));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">50</span>]));</pre></div>
|
||
<p>Always returns <code>true</code> if <code>needle</code> is an empty slice:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span>[]));
|
||
<span class="kw">let</span> <span class="ident">v</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>] <span class="op">=</span> <span class="kw-2">&</span>[];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span>[]));</pre></div>
|
||
</div><h4 id='method.ends_with' class="method"><code id='ends_with.v'>pub fn <a href='#method.ends_with' class='fnname'>ends_with</a>(&self, needle: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><T>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1455-1461' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if <code>needle</code> is a suffix of the slice.</p>
|
||
<h1 id="examples-38" class="section-header"><a href="#examples-38">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">ends_with</span>(<span class="kw-2">&</span>[<span class="number">30</span>]));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">ends_with</span>(<span class="kw-2">&</span>[<span class="number">40</span>, <span class="number">30</span>]));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">ends_with</span>(<span class="kw-2">&</span>[<span class="number">50</span>]));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">ends_with</span>(<span class="kw-2">&</span>[<span class="number">50</span>, <span class="number">30</span>]));</pre></div>
|
||
<p>Always returns <code>true</code> if <code>needle</code> is an empty slice:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> <span class="kw-2">&</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">ends_with</span>(<span class="kw-2">&</span>[]));
|
||
<span class="kw">let</span> <span class="ident">v</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>] <span class="op">=</span> <span class="kw-2">&</span>[];
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">ends_with</span>(<span class="kw-2">&</span>[]));</pre></div>
|
||
</div><h4 id='method.binary_search' class="method"><code id='binary_search.v'>pub fn <a href='#method.binary_search' class='fnname'>binary_search</a>(&self, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1498-1503' title='goto source code'>[src]</a></h4><div class='docblock'><p>Binary searches this sorted slice for a given element.</p>
|
||
<p>If the value is found then [<code>Result::Ok</code>] is returned, containing the
|
||
index of the matching element. If there are multiple matches, then any
|
||
one of the matches could be returned. If the value is not found then
|
||
[<code>Result::Err</code>] is returned, containing the index where a matching
|
||
element could be inserted while maintaining sorted order.</p>
|
||
<h1 id="examples-39" class="section-header"><a href="#examples-39">Examples</a></h1>
|
||
<p>Looks up a series of four elements. The first is found, with a
|
||
uniquely determined position; the second and third are not
|
||
found; the fourth could match any position in <code>[1, 4]</code>.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> [<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">13</span>, <span class="number">21</span>, <span class="number">34</span>, <span class="number">55</span>];
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search</span>(<span class="kw-2">&</span><span class="number">13</span>), <span class="prelude-val">Ok</span>(<span class="number">9</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search</span>(<span class="kw-2">&</span><span class="number">4</span>), <span class="prelude-val">Err</span>(<span class="number">7</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search</span>(<span class="kw-2">&</span><span class="number">100</span>), <span class="prelude-val">Err</span>(<span class="number">13</span>));
|
||
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">s</span>.<span class="ident">binary_search</span>(<span class="kw-2">&</span><span class="number">1</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="kw">match</span> <span class="ident">r</span> { <span class="prelude-val">Ok</span>(<span class="number">1</span>..<span class="op">=</span><span class="number">4</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>, <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>, });</pre></div>
|
||
<p>If you want to insert an item to a sorted vector, while maintaining
|
||
sort order:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">s</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">13</span>, <span class="number">21</span>, <span class="number">34</span>, <span class="number">55</span>];
|
||
<span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="number">42</span>;
|
||
<span class="kw">let</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">s</span>.<span class="ident">binary_search</span>(<span class="kw-2">&</span><span class="ident">num</span>).<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>);
|
||
<span class="ident">s</span>.<span class="ident">insert</span>(<span class="ident">idx</span>, <span class="ident">num</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>, [<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">13</span>, <span class="number">21</span>, <span class="number">34</span>, <span class="number">42</span>, <span class="number">55</span>]);</pre></div>
|
||
</div><h4 id='method.binary_search_by' class="method"><code id='binary_search_by.v'>pub fn <a href='#method.binary_search_by' class='fnname'>binary_search_by</a><'a, F>(&'a self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1539-1562' title='goto source code'>[src]</a></h4><div class='docblock'><p>Binary searches this sorted slice with a comparator function.</p>
|
||
<p>The comparator function should implement an order consistent
|
||
with the sort order of the underlying slice, returning an
|
||
order code that indicates whether its argument is <code>Less</code>,
|
||
<code>Equal</code> or <code>Greater</code> the desired target.</p>
|
||
<p>If the value is found then [<code>Result::Ok</code>] is returned, containing the
|
||
index of the matching element. If there are multiple matches, then any
|
||
one of the matches could be returned. If the value is not found then
|
||
[<code>Result::Err</code>] is returned, containing the index where a matching
|
||
element could be inserted while maintaining sorted order.</p>
|
||
<h1 id="examples-40" class="section-header"><a href="#examples-40">Examples</a></h1>
|
||
<p>Looks up a series of four elements. The first is found, with a
|
||
uniquely determined position; the second and third are not
|
||
found; the fourth could match any position in <code>[1, 4]</code>.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> [<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">13</span>, <span class="number">21</span>, <span class="number">34</span>, <span class="number">55</span>];
|
||
|
||
<span class="kw">let</span> <span class="ident">seek</span> <span class="op">=</span> <span class="number">13</span>;
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search_by</span>(<span class="op">|</span><span class="ident">probe</span><span class="op">|</span> <span class="ident">probe</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">seek</span>)), <span class="prelude-val">Ok</span>(<span class="number">9</span>));
|
||
<span class="kw">let</span> <span class="ident">seek</span> <span class="op">=</span> <span class="number">4</span>;
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search_by</span>(<span class="op">|</span><span class="ident">probe</span><span class="op">|</span> <span class="ident">probe</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">seek</span>)), <span class="prelude-val">Err</span>(<span class="number">7</span>));
|
||
<span class="kw">let</span> <span class="ident">seek</span> <span class="op">=</span> <span class="number">100</span>;
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search_by</span>(<span class="op">|</span><span class="ident">probe</span><span class="op">|</span> <span class="ident">probe</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">seek</span>)), <span class="prelude-val">Err</span>(<span class="number">13</span>));
|
||
<span class="kw">let</span> <span class="ident">seek</span> <span class="op">=</span> <span class="number">1</span>;
|
||
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">s</span>.<span class="ident">binary_search_by</span>(<span class="op">|</span><span class="ident">probe</span><span class="op">|</span> <span class="ident">probe</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">seek</span>));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="kw">match</span> <span class="ident">r</span> { <span class="prelude-val">Ok</span>(<span class="number">1</span>..<span class="op">=</span><span class="number">4</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>, <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>, });</pre></div>
|
||
</div><h4 id='method.binary_search_by_key' class="method"><code id='binary_search_by_key.v'>pub fn <a href='#method.binary_search_by_key' class='fnname'>binary_search_by_key</a><'a, B, F>(<br> &'a self, <br> b: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>B, <br> f: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>T) -> B, </span></code><span class='since' title='Stable since Rust version 1.10.0'>1.10.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1597-1603' title='goto source code'>[src]</a></h4><div class='docblock'><p>Binary searches this sorted slice with a key extraction function.</p>
|
||
<p>Assumes that the slice is sorted by the key, for instance with
|
||
<a href="#method.sort_by_key"><code>sort_by_key</code></a> using the same key extraction function.</p>
|
||
<p>If the value is found then [<code>Result::Ok</code>] is returned, containing the
|
||
index of the matching element. If there are multiple matches, then any
|
||
one of the matches could be returned. If the value is not found then
|
||
[<code>Result::Err</code>] is returned, containing the index where a matching
|
||
element could be inserted while maintaining sorted order.</p>
|
||
<h1 id="examples-41" class="section-header"><a href="#examples-41">Examples</a></h1>
|
||
<p>Looks up a series of four elements in a slice of pairs sorted by
|
||
their second elements. The first is found, with a uniquely
|
||
determined position; the second and third are not found; the
|
||
fourth could match any position in <code>[1, 4]</code>.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> [(<span class="number">0</span>, <span class="number">0</span>), (<span class="number">2</span>, <span class="number">1</span>), (<span class="number">4</span>, <span class="number">1</span>), (<span class="number">5</span>, <span class="number">1</span>), (<span class="number">3</span>, <span class="number">1</span>),
|
||
(<span class="number">1</span>, <span class="number">2</span>), (<span class="number">2</span>, <span class="number">3</span>), (<span class="number">4</span>, <span class="number">5</span>), (<span class="number">5</span>, <span class="number">8</span>), (<span class="number">3</span>, <span class="number">13</span>),
|
||
(<span class="number">1</span>, <span class="number">21</span>), (<span class="number">2</span>, <span class="number">34</span>), (<span class="number">4</span>, <span class="number">55</span>)];
|
||
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search_by_key</span>(<span class="kw-2">&</span><span class="number">13</span>, <span class="op">|</span><span class="kw-2">&</span>(<span class="ident">a</span>,<span class="ident">b</span>)<span class="op">|</span> <span class="ident">b</span>), <span class="prelude-val">Ok</span>(<span class="number">9</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search_by_key</span>(<span class="kw-2">&</span><span class="number">4</span>, <span class="op">|</span><span class="kw-2">&</span>(<span class="ident">a</span>,<span class="ident">b</span>)<span class="op">|</span> <span class="ident">b</span>), <span class="prelude-val">Err</span>(<span class="number">7</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">s</span>.<span class="ident">binary_search_by_key</span>(<span class="kw-2">&</span><span class="number">100</span>, <span class="op">|</span><span class="kw-2">&</span>(<span class="ident">a</span>,<span class="ident">b</span>)<span class="op">|</span> <span class="ident">b</span>), <span class="prelude-val">Err</span>(<span class="number">13</span>));
|
||
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">s</span>.<span class="ident">binary_search_by_key</span>(<span class="kw-2">&</span><span class="number">1</span>, <span class="op">|</span><span class="kw-2">&</span>(<span class="ident">a</span>,<span class="ident">b</span>)<span class="op">|</span> <span class="ident">b</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="kw">match</span> <span class="ident">r</span> { <span class="prelude-val">Ok</span>(<span class="number">1</span>..<span class="op">=</span><span class="number">4</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>, <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>, });</pre></div>
|
||
</div><h4 id='method.align_to' class="method"><code id='align_to.v'>pub unsafe fn <a href='#method.align_to' class='fnname'>align_to</a><U>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[U]</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[T]</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2487-2510' title='goto source code'>[src]</a></h4><div class='docblock'><p>Transmute the slice to a slice of another type, ensuring alignment of the types is
|
||
maintained.</p>
|
||
<p>This method splits the slice into three distinct slices: prefix, correctly aligned middle
|
||
slice of a new type, and the suffix slice. The method may make the middle slice the greatest
|
||
length possible for a given type and input slice, but only your algorithm's performance
|
||
should depend on that, not its correctness. It is permissible for all of the input data to
|
||
be returned as the prefix or suffix slice.</p>
|
||
<p>This method has no purpose when either input element <code>T</code> or output element <code>U</code> are
|
||
zero-sized and will return the original slice without splitting anything.</p>
|
||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||
<p>This method is essentially a <code>transmute</code> with respect to the elements in the returned
|
||
middle slice, so all the usual caveats pertaining to <code>transmute::<T, U></code> also apply here.</p>
|
||
<h1 id="examples-42" class="section-header"><a href="#examples-42">Examples</a></h1>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">unsafe</span> {
|
||
<span class="kw">let</span> <span class="ident">bytes</span>: [<span class="ident">u8</span>; <span class="number">7</span>] <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>];
|
||
<span class="kw">let</span> (<span class="ident">prefix</span>, <span class="ident">shorts</span>, <span class="ident">suffix</span>) <span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">align_to</span>::<span class="op"><</span><span class="ident">u16</span><span class="op">></span>();
|
||
<span class="comment">// less_efficient_algorithm_for_bytes(prefix);</span>
|
||
<span class="comment">// more_efficient_algorithm_for_aligned_shorts(shorts);</span>
|
||
<span class="comment">// less_efficient_algorithm_for_bytes(suffix);</span>
|
||
}</pre></div>
|
||
</div><h4 id='method.is_sorted' class="method"><code id='is_sorted.v'>pub fn <a href='#method.is_sorted' class='fnname'>is_sorted</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><T>, </span></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2594-2599' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</summary><p>new API</p>
|
||
</details></div></div><div class='docblock'><p>Checks if the elements of this slice are sorted.</p>
|
||
<p>That is, for each element <code>a</code> and its following element <code>b</code>, <code>a <= b</code> must hold. If the
|
||
slice yields exactly zero or one element, <code>true</code> is returned.</p>
|
||
<p>Note that if <code>Self::Item</code> is only <code>PartialOrd</code>, but not <code>Ord</code>, the above definition
|
||
implies that this function returns <code>false</code> if any two consecutive items are not
|
||
comparable.</p>
|
||
<h1 id="examples-43" class="section-header"><a href="#examples-43">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">is_sorted</span>)]</span>
|
||
<span class="kw">let</span> <span class="ident">empty</span>: [<span class="ident">i32</span>; <span class="number">0</span>] <span class="op">=</span> [];
|
||
|
||
<span class="macro">assert</span><span class="macro">!</span>([<span class="number">1</span>, <span class="number">2</span>, <span class="number">2</span>, <span class="number">9</span>].<span class="ident">is_sorted</span>());
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span>[<span class="number">1</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">4</span>].<span class="ident">is_sorted</span>());
|
||
<span class="macro">assert</span><span class="macro">!</span>([<span class="number">0</span>].<span class="ident">is_sorted</span>());
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">empty</span>.<span class="ident">is_sorted</span>());
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span>[<span class="number">0.0</span>, <span class="number">1.0</span>, <span class="ident">std</span>::<span class="ident">f32</span>::<span class="ident">NAN</span>].<span class="ident">is_sorted</span>());</pre></div>
|
||
</div><h4 id='method.is_sorted_by' class="method"><code id='is_sorted_by.v'>pub fn <a href='#method.is_sorted_by' class='fnname'>is_sorted_by</a><F>(&self, compare: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>>, </span></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2609-2614' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</summary><p>new API</p>
|
||
</details></div></div><div class='docblock'><p>Checks if the elements of this slice are sorted using the given comparator function.</p>
|
||
<p>Instead of using <code>PartialOrd::partial_cmp</code>, this function uses the given <code>compare</code>
|
||
function to determine the ordering of two elements. Apart from that, it's equivalent to
|
||
<a href="#method.is_sorted"><code>is_sorted</code></a>; see its documentation for more information.</p>
|
||
</div><h4 id='method.is_sorted_by_key' class="method"><code id='is_sorted_by_key.v'>pub fn <a href='#method.is_sorted_by_key' class='fnname'>is_sorted_by_key</a><F, K>(&self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T) -> K,<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><K>, </span></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2634-2640' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</summary><p>new API</p>
|
||
</details></div></div><div class='docblock'><p>Checks if the elements of this slice are sorted using the given key extraction function.</p>
|
||
<p>Instead of comparing the slice's elements directly, this function compares the keys of the
|
||
elements, as determined by <code>f</code>. Apart from that, it's equivalent to <a href="#method.is_sorted"><code>is_sorted</code></a>; see its
|
||
documentation for more information.</p>
|
||
<h1 id="examples-44" class="section-header"><a href="#examples-44">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">is_sorted</span>)]</span>
|
||
|
||
<span class="macro">assert</span><span class="macro">!</span>([<span class="string">"c"</span>, <span class="string">"bb"</span>, <span class="string">"aaa"</span>].<span class="ident">is_sorted_by_key</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">s</span>.<span class="ident">len</span>()));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span>[<span class="op">-</span><span class="number">2i32</span>, <span class="op">-</span><span class="number">1</span>, <span class="number">0</span>, <span class="number">3</span>].<span class="ident">is_sorted_by_key</span>(<span class="op">|</span><span class="ident">n</span><span class="op">|</span> <span class="ident">n</span>.<span class="ident">abs</span>()));</pre></div>
|
||
</div></div><div class='impl-items'><h4 id='method.is_ascii' class="method"><code id='is_ascii.v'>pub fn <a href='#method.is_ascii' class='fnname'>is_ascii</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.23.0'>1.23.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2649-2651' title='goto source code'>[src]</a></h4><div class='docblock'><p>Checks if all bytes in this slice are within the ASCII range.</p>
|
||
</div><h4 id='method.eq_ignore_ascii_case' class="method"><code id='eq_ignore_ascii_case.v'>pub fn <a href='#method.eq_ignore_ascii_case' class='fnname'>eq_ignore_ascii_case</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.23.0'>1.23.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2659-2661' title='goto source code'>[src]</a></h4><div class='docblock'><p>Checks that two slices are an ASCII case-insensitive match.</p>
|
||
<p>Same as <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>,
|
||
but without allocating and copying temporaries.</p>
|
||
</div></div><div class='impl-items'><h4 id='method.to_vec' class="method"><code id='to_vec.v'>pub fn <a href='#method.to_vec' class='fnname'>to_vec</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#389-395' title='goto source code'>[src]</a></h4><div class='docblock'><p>Copies <code>self</code> into a new <code>Vec</code>.</p>
|
||
<h1 id="examples-45" class="section-header"><a href="#examples-45">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
|
||
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">s</span>.<span class="ident">to_vec</span>();
|
||
<span class="comment">// Here, `s` and `x` can be modified independently.</span></pre></div>
|
||
</div><h4 id='method.repeat' class="method"><code id='repeat.v'>pub fn <a href='#method.repeat' class='fnname'>repeat</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code><span class='since' title='Stable since Rust version 1.40.0'>1.40.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#439-495' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a vector by repeating a slice <code>n</code> times.</p>
|
||
<h1 id="panics-13" class="section-header"><a href="#panics-13">Panics</a></h1>
|
||
<p>This function will panic if the capacity would overflow.</p>
|
||
<h1 id="examples-46" class="section-header"><a href="#examples-46">Examples</a></h1>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([<span class="number">1</span>, <span class="number">2</span>].<span class="ident">repeat</span>(<span class="number">3</span>), <span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">2</span>]);</pre></div>
|
||
<p>A panic upon overflow:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="comment">// this will panic at runtime</span>
|
||
<span class="string">b"0123456789abcdef"</span>.<span class="ident">repeat</span>(<span class="ident">usize</span>::<span class="ident">max_value</span>());</pre></div>
|
||
</div><h4 id='method.concat' class="method"><code id='concat.v'>pub fn <a href='#method.concat' class='fnname'>concat</a><Item>(&self) -> <<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Concat.html" title="trait alloc::slice::Concat">Concat</a><Item>>::<a class="type" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Concat.html#associatedtype.Output" title="type alloc::slice::Concat::Output">Output</a> <span class="where fmt-newline">where<br> Item: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Concat.html" title="trait alloc::slice::Concat">Concat</a><Item>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#506-511' title='goto source code'>[src]</a></h4><div class='docblock'><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>.</p>
|
||
<h1 id="examples-47" class="section-header"><a href="#examples-47">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([<span class="string">"hello"</span>, <span class="string">"world"</span>].<span class="ident">concat</span>(), <span class="string">"helloworld"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].<span class="ident">concat</span>(), [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>]);</pre></div>
|
||
</div><h4 id='method.join' class="method"><code id='join.v'>pub fn <a href='#method.join' class='fnname'>join</a><Separator>(<br> &self, <br> sep: Separator<br>) -> <<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a><Separator>>::<a class="type" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html#associatedtype.Output" title="type alloc::slice::Join::Output">Output</a> <span class="where fmt-newline">where<br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a><Separator>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#524-529' title='goto source code'>[src]</a></h4><div class='docblock'><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>, placing a
|
||
given separator between each.</p>
|
||
<h1 id="examples-48" class="section-header"><a href="#examples-48">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([<span class="string">"hello"</span>, <span class="string">"world"</span>].<span class="ident">join</span>(<span class="string">" "</span>), <span class="string">"hello world"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].<span class="ident">join</span>(<span class="kw-2">&</span><span class="number">0</span>), [<span class="number">1</span>, <span class="number">2</span>, <span class="number">0</span>, <span class="number">3</span>, <span class="number">4</span>]);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].<span class="ident">join</span>(<span class="kw-2">&</span>[<span class="number">0</span>, <span class="number">0</span>][..]), [<span class="number">1</span>, <span class="number">2</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">3</span>, <span class="number">4</span>]);</pre></div>
|
||
</div><h4 id='method.connect' class="method"><code id='connect.v'>pub fn <a href='#method.connect' class='fnname'>connect</a><Separator>(<br> &self, <br> sep: Separator<br>) -> <<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a><Separator>>::<a class="type" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html#associatedtype.Output" title="type alloc::slice::Join::Output">Output</a> <span class="where fmt-newline">where<br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a><Separator>, </span></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#543-548' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.3.0: <p>renamed to join</p>
|
||
</div></div><div class='docblock'><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>, placing a
|
||
given separator between each.</p>
|
||
<h1 id="examples-49" class="section-header"><a href="#examples-49">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([<span class="string">"hello"</span>, <span class="string">"world"</span>].<span class="ident">connect</span>(<span class="string">" "</span>), <span class="string">"hello world"</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].<span class="ident">connect</span>(<span class="kw-2">&</span><span class="number">0</span>), [<span class="number">1</span>, <span class="number">2</span>, <span class="number">0</span>, <span class="number">3</span>, <span class="number">4</span>]);</pre></div>
|
||
</div></div><div class='impl-items'><h4 id='method.to_ascii_uppercase' class="method"><code id='to_ascii_uppercase.v'>pub fn <a href='#method.to_ascii_uppercase' class='fnname'>to_ascii_uppercase</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>></code><span class='since' title='Stable since Rust version 1.23.0'>1.23.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#565-569' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a vector containing a copy of this slice where each byte
|
||
is mapped to its ASCII upper case equivalent.</p>
|
||
<p>ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
|
||
but non-ASCII letters are unchanged.</p>
|
||
<p>To uppercase the value in-place, use <a href="#method.make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
|
||
</div><h4 id='method.to_ascii_lowercase' class="method"><code id='to_ascii_lowercase.v'>pub fn <a href='#method.to_ascii_lowercase' class='fnname'>to_ascii_lowercase</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>></code><span class='since' title='Stable since Rust version 1.23.0'>1.23.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#582-586' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a vector containing a copy of this slice where each byte
|
||
is mapped to its ASCII lower case equivalent.</p>
|
||
<p>ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
|
||
but non-ASCII letters are unchanged.</p>
|
||
<p>To lowercase the value in-place, use <a href="#method.make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
|
||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-AsRef%3C%5Bu8%5D%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-AsRef%3C%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#861-866' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_ref' class="method hidden"><code id='as_ref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#863-865' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Borrow%3C%5Bu8%5D%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Borrow%3C%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#982-986' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#983-985' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#853-859' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#854-858' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#969-973' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, fmt: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#970-972' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#962-967' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#964-966' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
||
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#868-875' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#872-874' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||
</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#959-960' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Extend%3C%26%27a%20u8%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><&'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Extend%3C%26%27a%20u8%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#1032-1036' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extend-1' class="method hidden"><code id='extend.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#tymethod.extend' class='fnname'>extend</a><T>(&mut self, iter: T) <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = &'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, </span></code><a class='srclink' href='../../src/bytes/bytes.rs.html#1033-1035' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></p>
|
||
</div></div><h3 id='impl-Extend%3Cu8%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Extend%3Cu8%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#1006-1030' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extend' class="method hidden"><code id='extend.v'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#tymethod.extend' class='fnname'>extend</a><T>(&mut self, iter: T) <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, </span></code><a class='srclink' href='../../src/bytes/bytes.rs.html#1007-1029' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></p>
|
||
</div></div><h3 id='impl-From%3C%26%27a%20%5Bu8%5D%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'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>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3C%26%27a%20%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#895-899' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code id='from.v-5'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'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>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#896-898' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3C%26%27a%20str%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><&'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3C%26%27a%20str%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#901-905' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code id='from.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: &'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#902-904' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CAuthority%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/http/uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CAuthority%3E' class='anchor'></a><a class='srclink' href='../../src/http/uri/authority.rs.html#481-486' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-14' class="method hidden"><code id='from.v-14'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="../../actix_web/http/uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/uri/authority.rs.html#483-485' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CByteStr%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><ByteStr> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CByteStr%3E' class='anchor'></a><a class='srclink' href='../../src/http/byte_str.rs.html#57-61' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-13' class="method hidden"><code id='from.v-13'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: ByteStr) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/byte_str.rs.html#58-60' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CBytes%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/web/struct.HttpResponse.html" title="struct actix_web::web::HttpResponse">Response</a><<a class="enum" href="../../actix_web/dev/enum.Body.html" title="enum actix_web::dev::Body">Body</a>></code><a href='#impl-From%3CBytes%3E' class='anchor'></a><a class='srclink' href='../../src/actix_http/response.rs.html#837-843' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(val: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="struct" href="../../actix_web/web/struct.HttpResponse.html" title="struct actix_web::web::HttpResponse">Response</a><<a class="enum" href="../../actix_web/dev/enum.Body.html" title="enum actix_web::dev::Body">Body</a>></code><a class='srclink' href='../../src/actix_http/response.rs.html#838-842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CBytes%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="enum" href="../../actix_web/dev/enum.Body.html" title="enum actix_web::dev::Body">Body</a></code><a href='#impl-From%3CBytes%3E-1' class='anchor'></a><a class='srclink' href='../../src/actix_http/body.rs.html#225-229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="../../actix_web/dev/enum.Body.html" title="enum actix_web::dev::Body">Body</a></code><a class='srclink' href='../../src/actix_http/body.rs.html#226-228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CBytes%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a></code><a href='#impl-From%3CBytes%3E-2' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#1653-1658' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code id='from.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#1654-1657' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CBytesMut%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CBytesMut%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#877-881' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CCustom%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Custom> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CCustom%3E' class='anchor'></a><a class='srclink' href='../../src/http/header/name.rs.html#1873-1878' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-9' class="method hidden"><code id='from.v-9'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(Custom) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/header/name.rs.html#1875-1877' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CHeaderName%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/http/struct.HeaderName.html" title="struct actix_web::http::HeaderName">HeaderName</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CHeaderName%3E' class='anchor'></a><a class='srclink' href='../../src/http/header/name.rs.html#1880-1885' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-10' class="method hidden"><code id='from.v-10'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(name: <a class="struct" href="../../actix_web/http/struct.HeaderName.html" title="struct actix_web::http::HeaderName">HeaderName</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/header/name.rs.html#1882-1884' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CHeaderValue%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/http/struct.HeaderValue.html" title="struct actix_web::http::HeaderValue">HeaderValue</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CHeaderValue%3E' class='anchor'></a><a class='srclink' href='../../src/http/header/value.rs.html#491-496' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-11' class="method hidden"><code id='from.v-11'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(value: <a class="struct" href="../../actix_web/http/struct.HeaderValue.html" title="struct actix_web::http::HeaderValue">HeaderValue</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/header/value.rs.html#493-495' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CPathAndQuery%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/http/uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CPathAndQuery%3E' class='anchor'></a><a class='srclink' href='../../src/http/uri/path.rs.html#319-323' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-12' class="method hidden"><code id='from.v-12'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="../../actix_web/http/uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/uri/path.rs.html#320-322' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CScheme%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../actix_web/http/uri/struct.Scheme.html" title="struct actix_web::http::uri::Scheme">Scheme</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CScheme%3E' class='anchor'></a><a class='srclink' href='../../src/http/uri/scheme.rs.html#156-169' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-8' class="method hidden"><code id='from.v-8'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="../../actix_web/http/uri/struct.Scheme.html" title="struct actix_web::http::uri::Scheme">Scheme</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/http/uri/scheme.rs.html#158-168' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CString%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CString%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#889-893' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code id='from.v-7'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#890-892' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CVec%3Cu8%3E%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-From%3CVec%3Cu8%3E%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#883-887' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code id='from.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(src: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#884-886' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-FromBuf' class='impl'><code class='in-band'>impl <a class="trait" href="../../bytes/buf/from_buf/trait.FromBuf.html" title="trait bytes::buf::from_buf::FromBuf">FromBuf</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-FromBuf' class='anchor'></a><a class='srclink' href='../../src/bytes/buf/from_buf.rs.html#100-106' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_buf' class="method hidden"><code id='from_buf.v'>fn <a href='../../bytes/buf/from_buf/trait.FromBuf.html#tymethod.from_buf' class='fnname'>from_buf</a><T>(buf: T) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../bytes/buf/into_buf/trait.IntoBuf.html" title="trait bytes::buf::into_buf::IntoBuf">IntoBuf</a>, </span></code><a class='srclink' href='../../src/bytes/buf/from_buf.rs.html#101-105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a value from a buffer. <a href="../../bytes/buf/from_buf/trait.FromBuf.html#tymethod.from_buf">Read more</a></p>
|
||
</div></div><h3 id='impl-FromIterator%3C%26%27a%20u8%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><&'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-FromIterator%3C%26%27a%20u8%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#935-939' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_iter' class="method hidden"><code id='from_iter.v'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter' class='fnname'>from_iter</a><T>(into_iter: T) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = &'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, </span></code><a class='srclink' href='../../src/bytes/bytes.rs.html#936-938' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a value from an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></p>
|
||
</div></div><h3 id='impl-FromIterator%3Cu8%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-FromIterator%3Cu8%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#923-927' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_iter-1' class="method hidden"><code id='from_iter.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter' class='fnname'>from_iter</a><T>(into_iter: T) -> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, </span></code><a class='srclink' href='../../src/bytes/bytes.rs.html#924-926' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a value from an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></p>
|
||
</div></div><h3 id='impl-FromRequest' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-FromRequest' class='anchor'></a><a class='srclink' href='../../src/actix_web/types/payload.rs.html#130-155' title='goto source code'>[src]</a></h3><div class='docblock'><p>Request binary data from a request's payload.</p>
|
||
<p>Loads request's payload and construct Bytes instance.</p>
|
||
<p><a href="struct.PayloadConfig.html"><strong>PayloadConfig</strong></a> allows to configure
|
||
extraction process.</p>
|
||
<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">bytes</span>::<span class="ident">Bytes</span>;
|
||
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">web</span>, <span class="ident">App</span>};
|
||
|
||
<span class="doccomment">/// extract binary data from request</span>
|
||
<span class="kw">fn</span> <span class="ident">index</span>(<span class="ident">body</span>: <span class="ident">Bytes</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
|
||
<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Body {:?}!"</span>, <span class="ident">body</span>)
|
||
}
|
||
|
||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span>::<span class="ident">new</span>().<span class="ident">service</span>(
|
||
<span class="ident">web</span>::<span class="ident">resource</span>(<span class="string">"/index.html"</span>).<span class="ident">route</span>(
|
||
<span class="ident">web</span>::<span class="ident">get</span>().<span class="ident">to</span>(<span class="ident">index</span>))
|
||
);
|
||
}</pre></div>
|
||
</div><div class='impl-items'><h4 id='associatedtype.Config' class="type"><code id='Config.t'>type <a href='../../actix_web/trait.FromRequest.html#associatedtype.Config' class="type">Config</a> = <a class="struct" href="../../actix_web/web/struct.PayloadConfig.html" title="struct actix_web::web::PayloadConfig">PayloadConfig</a></code></h4><div class='docblock'><p>Configuration for this extractor</p>
|
||
</div><h4 id='associatedtype.Error-7' class="type"><code id='Error.t-7'>type <a href='../../actix_web/trait.FromRequest.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a></code></h4><div class='docblock'><p>The associated error which can be returned.</p>
|
||
</div><h4 id='associatedtype.Future' class="type"><code id='Future.t'>type <a href='../../actix_web/trait.FromRequest.html#associatedtype.Future' class="type">Future</a> = <a class="enum" href="../../futures/future/either/enum.Either.html" title="enum futures::future::either::Either">Either</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Item = <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>, Error = <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>>>, <a class="struct" href="../../futures/future/result_/struct.FutureResult.html" title="struct futures::future::result_::FutureResult">FutureResult</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>>></code></h4><div class='docblock'><p>Future that resolves to a Self</p>
|
||
</div><h4 id='method.from_request' class="method hidden"><code id='from_request.v'>fn <a href='../../actix_web/trait.FromRequest.html#tymethod.from_request' class='fnname'>from_request</a>(req: &<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>, payload: &mut <a class="enum" href="../../actix_web/dev/enum.Payload.html" title="enum actix_web::dev::Payload">Payload</a>) -> Self::<a class="type" href="../../actix_web/trait.FromRequest.html#associatedtype.Future" title="type actix_web::FromRequest::Future">Future</a></code><a class='srclink' href='../../src/actix_web/types/payload.rs.html#137-154' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Convert request to a Self</p>
|
||
</div><h4 id='method.extract' class="method hidden"><code id='extract.v'>fn <a href='../../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>) -> Self::<a class="type" href="../../actix_web/trait.FromRequest.html#associatedtype.Future" title="type actix_web::FromRequest::Future">Future</a></code><a class='srclink' href='../../src/actix_web/extract.rs.html#29-31' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Convert request to a Self <a href="../../actix_web/trait.FromRequest.html#method.extract">Read more</a></p>
|
||
</div><h4 id='method.configure' class="method hidden"><code id='configure.v'>fn <a href='../../actix_web/trait.FromRequest.html#method.configure' class='fnname'>configure</a><F>(f: F) -> Self::<a class="type" href="../../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -> Self::<a class="type" href="../../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, </span></code><a class='srclink' href='../../src/actix_web/extract.rs.html#34-39' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create and configure config instance.</p>
|
||
</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#975-980' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><a class='srclink' href='../../src/bytes/bytes.rs.html#976-979' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
|
||
</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#194-201' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
|
||
</div></div><h3 id='impl-HttpTryFrom%3CBytes%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/http/struct.HeaderValue.html" title="struct actix_web::http::HeaderValue">HeaderValue</a></code><a href='#impl-HttpTryFrom%3CBytes%3E' class='anchor'></a><a class='srclink' href='../../src/http/header/value.rs.html#549-556' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/header/struct.InvalidHeaderValueBytes.html" title="struct actix_web::http::header::InvalidHeaderValueBytes">InvalidHeaderValueBytes</a></code></h4><div class='docblock'><p>Associated error with the conversion this implementation represents.</p>
|
||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='../../actix_web/http/trait.HttpTryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(<br> bytes: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/struct.HeaderValue.html" title="struct actix_web::http::HeaderValue">HeaderValue</a>, <<a class="struct" href="../../actix_web/http/struct.HeaderValue.html" title="struct actix_web::http::HeaderValue">HeaderValue</a> as <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>::<a class="type" href="../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error" title="type actix_web::http::HttpTryFrom::Error">Error</a>></code><a class='srclink' href='../../src/http/header/value.rs.html#553-555' title='goto source code'>[src]</a></h4></div><h3 id='impl-HttpTryFrom%3CBytes%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/http/struct.HeaderName.html" title="struct actix_web::http::HeaderName">HeaderName</a></code><a href='#impl-HttpTryFrom%3CBytes%3E-1' class='anchor'></a><a class='srclink' href='../../src/http/header/name.rs.html#1920-1926' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/header/struct.InvalidHeaderNameBytes.html" title="struct actix_web::http::header::InvalidHeaderNameBytes">InvalidHeaderNameBytes</a></code></h4><div class='docblock'><p>Associated error with the conversion this implementation represents.</p>
|
||
</div><h4 id='method.try_from-1' class="method hidden"><code id='try_from.v-1'>fn <a href='../../actix_web/http/trait.HttpTryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(<br> bytes: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/struct.HeaderName.html" title="struct actix_web::http::HeaderName">HeaderName</a>, <<a class="struct" href="../../actix_web/http/struct.HeaderName.html" title="struct actix_web::http::HeaderName">HeaderName</a> as <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>::<a class="type" href="../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error" title="type actix_web::http::HttpTryFrom::Error">Error</a>></code><a class='srclink' href='../../src/http/header/name.rs.html#1923-1925' title='goto source code'>[src]</a></h4></div><h3 id='impl-HttpTryFrom%3CBytes%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/http/uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a></code><a href='#impl-HttpTryFrom%3CBytes%3E-2' class='anchor'></a><a class='srclink' href='../../src/http/uri/authority.rs.html#440-446' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-3' class="type"><code id='Error.t-3'>type <a href='../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/uri/struct.InvalidUriBytes.html" title="struct actix_web::http::uri::InvalidUriBytes">InvalidUriBytes</a></code></h4><div class='docblock'><p>Associated error with the conversion this implementation represents.</p>
|
||
</div><h4 id='method.try_from-2' class="method hidden"><code id='try_from.v-2'>fn <a href='../../actix_web/http/trait.HttpTryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(<br> bytes: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a>, <<a class="struct" href="../../actix_web/http/uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a> as <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>::<a class="type" href="../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error" title="type actix_web::http::HttpTryFrom::Error">Error</a>></code><a class='srclink' href='../../src/http/uri/authority.rs.html#443-445' title='goto source code'>[src]</a></h4></div><h3 id='impl-HttpTryFrom%3CBytes%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/http/struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></code><a href='#impl-HttpTryFrom%3CBytes%3E-3' class='anchor'></a><a class='srclink' href='../../src/http/uri/mod.rs.html#737-744' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-4' class="type"><code id='Error.t-4'>type <a href='../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/uri/struct.InvalidUriBytes.html" title="struct actix_web::http::uri::InvalidUriBytes">InvalidUriBytes</a></code></h4><div class='docblock'><p>Associated error with the conversion this implementation represents.</p>
|
||
</div><h4 id='method.try_from-3' class="method hidden"><code id='try_from.v-3'>fn <a href='../../actix_web/http/trait.HttpTryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(t: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, <<a class="struct" href="../../actix_web/http/struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>::<a class="type" href="../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error" title="type actix_web::http::HttpTryFrom::Error">Error</a>></code><a class='srclink' href='../../src/http/uri/mod.rs.html#741-743' title='goto source code'>[src]</a></h4></div><h3 id='impl-HttpTryFrom%3CBytes%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/http/uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a></code><a href='#impl-HttpTryFrom%3CBytes%3E-4' class='anchor'></a><a class='srclink' href='../../src/http/uri/path.rs.html#287-293' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-5' class="type"><code id='Error.t-5'>type <a href='../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/uri/struct.InvalidUriBytes.html" title="struct actix_web::http::uri::InvalidUriBytes">InvalidUriBytes</a></code></h4><div class='docblock'><p>Associated error with the conversion this implementation represents.</p>
|
||
</div><h4 id='method.try_from-4' class="method hidden"><code id='try_from.v-4'>fn <a href='../../actix_web/http/trait.HttpTryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(<br> bytes: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a>, <<a class="struct" href="../../actix_web/http/uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a> as <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>::<a class="type" href="../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error" title="type actix_web::http::HttpTryFrom::Error">Error</a>></code><a class='srclink' href='../../src/http/uri/path.rs.html#290-292' title='goto source code'>[src]</a></h4></div><h3 id='impl-HttpTryFrom%3CBytes%3E-5' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/http/uri/struct.Scheme.html" title="struct actix_web::http::uri::Scheme">Scheme</a></code><a href='#impl-HttpTryFrom%3CBytes%3E-5' class='anchor'></a><a class='srclink' href='../../src/http/uri/scheme.rs.html#113-119' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-6' class="type"><code id='Error.t-6'>type <a href='../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/uri/struct.InvalidUriBytes.html" title="struct actix_web::http::uri::InvalidUriBytes">InvalidUriBytes</a></code></h4><div class='docblock'><p>Associated error with the conversion this implementation represents.</p>
|
||
</div><h4 id='method.try_from-5' class="method hidden"><code id='try_from.v-5'>fn <a href='../../actix_web/http/trait.HttpTryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(<br> bytes: <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/uri/struct.Scheme.html" title="struct actix_web::http::uri::Scheme">Scheme</a>, <<a class="struct" href="../../actix_web/http/uri/struct.Scheme.html" title="struct actix_web::http::uri::Scheme">Scheme</a> as <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>::<a class="type" href="../../actix_web/http/trait.HttpTryFrom.html#associatedtype.Error" title="type actix_web::http::HttpTryFrom::Error">Error</a>></code><a class='srclink' href='../../src/http/uri/scheme.rs.html#116-118' title='goto source code'>[src]</a></h4></div><h3 id='impl-IntoBuf' class='impl'><code class='in-band'>impl <a class="trait" href="../../bytes/buf/into_buf/trait.IntoBuf.html" title="trait bytes::buf::into_buf::IntoBuf">IntoBuf</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-IntoBuf' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#837-843' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Buf' class="type"><code id='Buf.t'>type <a href='../../bytes/buf/into_buf/trait.IntoBuf.html#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><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>></code></h4><div class='docblock'><p>The <code>Buf</code> type that <code>self</code> is being converted into</p>
|
||
</div><h4 id='method.into_buf' class="method hidden"><code id='into_buf.v'>fn <a href='../../bytes/buf/into_buf/trait.IntoBuf.html#tymethod.into_buf' class='fnname'>into_buf</a>(self) -> <<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> as <a class="trait" href="../../bytes/buf/into_buf/trait.IntoBuf.html" title="trait bytes::buf::into_buf::IntoBuf">IntoBuf</a>>::<a class="type" href="../../bytes/buf/into_buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::into_buf::IntoBuf::Buf">Buf</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#840-842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a <code>Buf</code> from a value. <a href="../../bytes/buf/into_buf/trait.IntoBuf.html#tymethod.into_buf">Read more</a></p>
|
||
</div></div><h3 id='impl-IntoBuf-1' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="../../bytes/buf/into_buf/trait.IntoBuf.html" title="trait bytes::buf::into_buf::IntoBuf">IntoBuf</a> for &'a <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-IntoBuf-1' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#845-851' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Buf-1' class="type"><code id='Buf.t-1'>type <a href='../../bytes/buf/into_buf/trait.IntoBuf.html#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><&'a <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>></code></h4><div class='docblock'><p>The <code>Buf</code> type that <code>self</code> is being converted into</p>
|
||
</div><h4 id='method.into_buf-1' class="method hidden"><code id='into_buf.v-1'>fn <a href='../../bytes/buf/into_buf/trait.IntoBuf.html#tymethod.into_buf' class='fnname'>into_buf</a>(self) -> <&'a <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> as <a class="trait" href="../../bytes/buf/into_buf/trait.IntoBuf.html" title="trait bytes::buf::into_buf::IntoBuf">IntoBuf</a>>::<a class="type" href="../../bytes/buf/into_buf/trait.IntoBuf.html#associatedtype.Buf" title="type bytes::buf::into_buf::IntoBuf::Buf">Buf</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#848-850' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a <code>Buf</code> from a value. <a href="../../bytes/buf/into_buf/trait.IntoBuf.html#tymethod.into_buf">Read more</a></p>
|
||
</div></div><h3 id='impl-IntoHeaderValue' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/http/header/trait.IntoHeaderValue.html" title="trait actix_web::http::header::IntoHeaderValue">IntoHeaderValue</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-IntoHeaderValue' class='anchor'></a><a class='srclink' href='../../src/actix_http/header/mod.rs.html#75-82' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='../../actix_web/http/header/trait.IntoHeaderValue.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/http/header/struct.InvalidHeaderValueBytes.html" title="struct actix_web::http::header::InvalidHeaderValueBytes">InvalidHeaderValueBytes</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='../../actix_web/http/header/trait.IntoHeaderValue.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/http/struct.HeaderValue.html" title="struct actix_web::http::HeaderValue">HeaderValue</a>, <<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> as <a class="trait" href="../../actix_web/http/header/trait.IntoHeaderValue.html" title="trait actix_web::http::header::IntoHeaderValue">IntoHeaderValue</a>>::<a class="type" href="../../actix_web/http/header/trait.IntoHeaderValue.html#associatedtype.Error" title="type actix_web::http::header::IntoHeaderValue::Error">Error</a>></code><a class='srclink' href='../../src/actix_http/header/mod.rs.html#79-81' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Try to convert value to a Header value.</p>
|
||
</div></div><h3 id='impl-IntoIterator' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-IntoIterator' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#988-995' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><code id='Item.t'>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></h4><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||
</div><h4 id='associatedtype.IntoIter' class="type"><code id='IntoIter.t'>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../bytes/buf/iter/struct.Iter.html" title="struct bytes::buf::iter::Iter">Iter</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><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>></code></h4><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
|
||
</div><h4 id='method.into_iter' class="method hidden"><code id='into_iter.v'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -> <<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#992-994' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
|
||
</div></div><h3 id='impl-IntoIterator-1' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for &'a <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-IntoIterator-1' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#997-1004' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Item-1' class="type"><code id='Item.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></h4><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||
</div><h4 id='associatedtype.IntoIter-1' class="type"><code id='IntoIter.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../bytes/buf/iter/struct.Iter.html" title="struct bytes::buf::iter::Iter">Iter</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><&'a <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>></code></h4><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
|
||
</div><h4 id='method.into_iter-1' class="method hidden"><code id='into_iter.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -> <&'a <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#1001-1003' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
|
||
</div></div><h3 id='impl-MessageBody' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/dev/trait.MessageBody.html" title="trait actix_web::dev::MessageBody">MessageBody</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-MessageBody' class='anchor'></a><a class='srclink' href='../../src/actix_http/body.rs.html#262-274' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.size' class="method hidden"><code id='size.v'>fn <a href='../../actix_web/dev/trait.MessageBody.html#tymethod.size' class='fnname'>size</a>(&self) -> <a class="enum" href="../../actix_web/dev/enum.BodySize.html" title="enum actix_web::dev::BodySize">BodySize</a></code><a class='srclink' href='../../src/actix_http/body.rs.html#263-265' title='goto source code'>[src]</a></h4><h4 id='method.poll_next' class="method hidden"><code id='poll_next.v'>fn <a href='../../actix_web/dev/trait.MessageBody.html#tymethod.poll_next' class='fnname'>poll_next</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../futures/poll/enum.Async.html" title="enum futures::poll::Async">Async</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>>>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code><a class='srclink' href='../../src/actix_http/body.rs.html#267-273' title='goto source code'>[src]</a></h4></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#953-957' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#954-956' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
|
||
</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
|
||
</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
|
||
</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialEq%3C%26%27a%20T%3E' class='impl'><code class='in-band'>impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>T> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><T>, </span></code><a href='#impl-PartialEq%3C%26%27a%20T%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2901-2907' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-6' class="method hidden"><code id='eq.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2904-2906' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-6' class="method hidden"><code id='ne.v-6'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3C%5Bu8%5D%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialEq%3C%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2781-2785' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-8' class="method hidden"><code id='eq.v-8'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2782-2784' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-8' class="method hidden"><code id='ne.v-8'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CBytes%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'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-PartialEq%3CBytes%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2877-2881' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2878-2880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CBytes%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a></code><a href='#impl-PartialEq%3CBytes%3E-1' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2924-2929' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-2' class="method hidden"><code id='eq.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2926-2928' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-2' class="method hidden"><code id='ne.v-2'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CBytes%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialEq%3CBytes%3E-2' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#941-945' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-4' class="method hidden"><code id='eq.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#942-944' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-4' class="method hidden"><code id='ne.v-4'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CBytes%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a></code><a href='#impl-PartialEq%3CBytes%3E-3' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2793-2797' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-9' class="method hidden"><code id='eq.v-9'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2794-2796' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-9' class="method hidden"><code id='ne.v-9'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CBytes%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>></code><a href='#impl-PartialEq%3CBytes%3E-4' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2841-2845' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-10' class="method hidden"><code id='eq.v-10'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2842-2844' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-10' class="method hidden"><code id='ne.v-10'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CBytesMut%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialEq%3CBytesMut%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2917-2922' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-3' class="method hidden"><code id='eq.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.BytesMut.html" title="struct actix_web::web::BytesMut">BytesMut</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2919-2921' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-3' class="method hidden"><code id='ne.v-3'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CString%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialEq%3CString%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2853-2857' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-5' class="method hidden"><code id='eq.v-5'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2854-2856' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-5' class="method hidden"><code id='ne.v-5'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CVec%3Cu8%3E%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialEq%3CVec%3Cu8%3E%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2829-2833' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-7' class="method hidden"><code id='eq.v-7'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</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.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2830-2832' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-7' class="method hidden"><code id='ne.v-7'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialEq%3Cstr%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialEq%3Cstr%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2805-2809' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-1' class="method hidden"><code id='eq.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2806-2808' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne-1' class="method hidden"><code id='ne.v-1'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialOrd%3C%26%27a%20T%3E' class='impl'><code class='in-band'>impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>T> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a> <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><T>, </span></code><a href='#impl-PartialOrd%3C%26%27a%20T%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2909-2915' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-6' class="method hidden"><code id='partial_cmp.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2912-2914' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-6' class="method hidden"><code id='lt.v-6'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-6' class="method hidden"><code id='le.v-6'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-6' class="method hidden"><code id='gt.v-6'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-6' class="method hidden"><code id='ge.v-6'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3C%5Bu8%5D%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialOrd%3C%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2787-2791' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2788-2790' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt' class="method hidden"><code id='lt.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le' class="method hidden"><code id='le.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt' class="method hidden"><code id='gt.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge' class="method hidden"><code id='ge.v'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3CBytes%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.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.slice.html">]</a></code><a href='#impl-PartialOrd%3CBytes%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2799-2803' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-1' class="method hidden"><code id='partial_cmp.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2800-2802' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-1' class="method hidden"><code id='lt.v-1'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-1' class="method hidden"><code id='le.v-1'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-1' class="method hidden"><code id='gt.v-1'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-1' class="method hidden"><code id='ge.v-1'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3CBytes%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialOrd%3CBytes%3E-1' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#947-951' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-2' class="method hidden"><code id='partial_cmp.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#948-950' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-2' class="method hidden"><code id='lt.v-2'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-2' class="method hidden"><code id='le.v-2'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-2' class="method hidden"><code id='gt.v-2'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-2' class="method hidden"><code id='ge.v-2'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3CBytes%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>></code><a href='#impl-PartialOrd%3CBytes%3E-2' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2847-2851' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-3' class="method hidden"><code id='partial_cmp.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2848-2850' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-3' class="method hidden"><code id='lt.v-3'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-3' class="method hidden"><code id='le.v-3'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-3' class="method hidden"><code id='gt.v-3'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-3' class="method hidden"><code id='ge.v-3'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3CBytes%3E-3' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'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-PartialOrd%3CBytes%3E-3' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2883-2887' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-5' class="method hidden"><code id='partial_cmp.v-5'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2884-2886' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-5' class="method hidden"><code id='lt.v-5'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-5' class="method hidden"><code id='le.v-5'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-5' class="method hidden"><code id='gt.v-5'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-5' class="method hidden"><code id='ge.v-5'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3CString%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialOrd%3CString%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2859-2863' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-4' class="method hidden"><code id='partial_cmp.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2860-2862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-4' class="method hidden"><code id='lt.v-4'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-4' class="method hidden"><code id='le.v-4'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-4' class="method hidden"><code id='gt.v-4'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-4' class="method hidden"><code id='ge.v-4'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3CVec%3Cu8%3E%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialOrd%3CVec%3Cu8%3E%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2835-2839' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-7' class="method hidden"><code id='partial_cmp.v-7'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2836-2838' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-7' class="method hidden"><code id='lt.v-7'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-7' class="method hidden"><code id='le.v-7'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-7' class="method hidden"><code id='gt.v-7'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-7' class="method hidden"><code id='ge.v-7'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-PartialOrd%3Cstr%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-PartialOrd%3Cstr%3E' class='anchor'></a><a class='srclink' href='../../src/bytes/bytes.rs.html#2811-2815' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-8' class="method hidden"><code id='partial_cmp.v-8'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../src/bytes/bytes.rs.html#2812-2814' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt-8' class="method hidden"><code id='lt.v-8'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le-8' class="method hidden"><code id='le.v-8'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt-8' class="method hidden"><code id='gt.v-8'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge-8' class="method hidden"><code id='ge.v-8'><span class="docblock attributes">#[must_use]
|
||
</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 id='impl-Responder' class='impl'><code class='in-band'>impl <a class="trait" href="../../actix_web/trait.Responder.html" title="trait actix_web::Responder">Responder</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Responder' class='anchor'></a><a class='srclink' href='../../src/actix_web/responder.rs.html#200-209' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-8' class="type"><code id='Error.t-8'>type <a href='../../actix_web/trait.Responder.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a></code></h4><div class='docblock'><p>The associated error which can be returned.</p>
|
||
</div><h4 id='associatedtype.Future-1' class="type"><code id='Future.t-1'>type <a href='../../actix_web/trait.Responder.html#associatedtype.Future' class="type">Future</a> = <a class="struct" href="../../futures/future/result_/struct.FutureResult.html" title="struct futures::future::result_::FutureResult">FutureResult</a><<a class="struct" href="../../actix_web/web/struct.HttpResponse.html" title="struct actix_web::web::HttpResponse">Response</a>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></h4><div class='docblock'><p>The future response value.</p>
|
||
</div><h4 id='method.respond_to' class="method hidden"><code id='respond_to.v'>fn <a href='../../actix_web/trait.Responder.html#tymethod.respond_to' class='fnname'>respond_to</a>(self, _: &<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>) -> Self::<a class="type" href="../../actix_web/trait.Responder.html#associatedtype.Future" title="type actix_web::Responder::Future">Future</a></code><a class='srclink' href='../../src/actix_web/responder.rs.html#204-208' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Convert itself to <code>AsyncResult</code> or <code>Error</code>.</p>
|
||
</div><h4 id='method.with_status' class="method hidden"><code id='with_status.v'>fn <a href='../../actix_web/trait.Responder.html#method.with_status' class='fnname'>with_status</a>(self, status: <a class="struct" href="../../actix_web/http/struct.StatusCode.html" title="struct actix_web::http::StatusCode">StatusCode</a>) -> CustomResponder<Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a class='srclink' href='../../src/actix_web/responder.rs.html#36-41' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Override a status code for a Responder. <a href="../../actix_web/trait.Responder.html#method.with_status">Read more</a></p>
|
||
</div><h4 id='method.with_header' class="method hidden"><code id='with_header.v'>fn <a href='../../actix_web/trait.Responder.html#method.with_header' class='fnname'>with_header</a><K, V>(self, key: K, value: V) -> CustomResponder<Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> <a class="struct" href="../../actix_web/http/struct.HeaderName.html" title="struct actix_web::http::HeaderName">HeaderName</a>: <a class="trait" href="../../actix_web/http/trait.HttpTryFrom.html" title="trait actix_web::http::HttpTryFrom">HttpTryFrom</a><K>,<br> V: <a class="trait" href="../../actix_web/http/header/trait.IntoHeaderValue.html" title="trait actix_web::http::header::IntoHeaderValue">IntoHeaderValue</a>, </span></code><a class='srclink' href='../../src/actix_web/responder.rs.html#62-69' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Add header to the Responder's response. <a href="../../actix_web/trait.Responder.html#method.with_header">Read more</a></p>
|
||
</div></div><h3 id='impl-StableAsRef' class='impl'><code class='in-band'>impl <a class="trait" href="../../string/trait.StableAsRef.html" title="trait string::StableAsRef">StableAsRef</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-StableAsRef' class='anchor'></a><a class='srclink' href='../../src/string/lib.rs.html#286' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../actix_web/web/struct.Bytes.html" title="struct actix_web::web::Bytes">Bytes</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow-1' class="method hidden"><code id='borrow.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||
</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="../../indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='../../src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='../../indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-15' class="method hidden"><code id='from.v-15'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-IntoBuf-2' class='impl'><code class='in-band'>impl<T> <a class="trait" href="../../bytes/buf/into_buf/trait.IntoBuf.html" title="trait bytes::buf::into_buf::IntoBuf">IntoBuf</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../bytes/buf/buf/trait.Buf.html" title="trait bytes::buf::buf::Buf">Buf</a>, </span></code><a href='#impl-IntoBuf-2' class='anchor'></a><a class='srclink' href='../../src/bytes/buf/into_buf.rs.html#50-56' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Buf-2' class="type"><code id='Buf.t-2'>type <a href='../../bytes/buf/into_buf/trait.IntoBuf.html#associatedtype.Buf' class="type">Buf</a> = T</code></h4><div class='docblock'><p>The <code>Buf</code> type that <code>self</code> is being converted into</p>
|
||
</div><h4 id='method.into_buf-2' class="method hidden"><code id='into_buf.v-2'>fn <a href='../../bytes/buf/into_buf/trait.IntoBuf.html#tymethod.into_buf' class='fnname'>into_buf</a>(self) -> T</code><a class='srclink' href='../../src/bytes/buf/into_buf.rs.html#53-55' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a <code>Buf</code> from a value. <a href="../../bytes/buf/into_buf/trait.IntoBuf.html#tymethod.into_buf">Read more</a></p>
|
||
</div></div><h3 id='impl-IntoIterator-2' class='impl'><code class='in-band'>impl<I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>, </span></code><a href='#impl-IntoIterator-2' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#243-250' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Item-2' class="type"><code id='Item.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a></code></h4><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||
</div><h4 id='associatedtype.IntoIter-2' class="type"><code id='IntoIter.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = I</code></h4><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
|
||
</div><h4 id='method.into_iter-2' class="method hidden"><code id='into_iter.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -> I</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#247-249' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
|
||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-9' class="type"><code id='Error.t-9'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_from-6' class="method hidden"><code id='try_from.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-10' class="type"><code id='Error.t-10'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_into-1' class="method hidden"><code id='try_into.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> <a class="trait" href="../../ppv_lite86/types/types/trait.VZip.html" title="trait ppv_lite86::types::types::VZip">VZip</a><V> for T <span class="where fmt-newline">where<br> V: <a class="trait" href="../../ppv_lite86/types/types/trait.MultiLane.html" title="trait ppv_lite86::types::types::MultiLane">MultiLane</a><T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a><a class='srclink' href='../../src/ppv_lite86/types.rs.html#212-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='../../ppv_lite86/types/types/trait.VZip.html#tymethod.vzip' class='fnname'>vzip</a>(self) -> V</code><a class='srclink' href='../../src/ppv_lite86/types.rs.html#217-219' title='goto source code'>[src]</a></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html> |