]> Untitled Git - bitcoindevkit.org/blob
a2f659d2d57732b9868755874b7f8b3d4cf45348
[bitcoindevkit.org] /
1 <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A DER serialized Signature"><title>SerializedSignature in bdk_chain::bitcoin::secp256k1::ecdsa::serialized_signature - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="bdk_chain" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (6d9f6ae36 2024-12-16)" data-channel="nightly" data-search-js="search-036cda7a.js" data-settings-js="settings-0f613d39.js" ><script src="../../../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt="logo"></a><h2><a href="../../../../../bdk_chain/index.html">bdk_<wbr>chain</a><span class="version">0.21.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Serialized<wbr>Signature</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.capacity" title="capacity">capacity</a></li><li><a href="#method.from_signature" title="from_signature">from_signature</a></li><li><a href="#method.is_empty" title="is_empty">is_empty</a></li><li><a href="#method.len" title="len">len</a></li><li><a href="#method.to_signature" title="to_signature">to_signature</a></li></ul><h3><a href="#deref-methods-%5Bu8%5D">Methods from Deref&lt;<wbr>Target=[u8]&gt;</a></h3><ul class="block deref-methods"><li><a href="#method.align_to" title="align_to">align_to</a></li><li><a href="#method.array_chunks" title="array_chunks">array_chunks</a></li><li><a href="#method.array_windows" title="array_windows">array_windows</a></li><li><a href="#method.as_array" title="as_array">as_array</a></li><li><a href="#method.as_ascii" title="as_ascii">as_ascii</a></li><li><a href="#method.as_ascii_unchecked" title="as_ascii_unchecked">as_ascii_unchecked</a></li><li><a href="#method.as_bytes" title="as_bytes">as_bytes</a></li><li><a href="#method.as_chunks" title="as_chunks">as_chunks</a></li><li><a href="#method.as_chunks_unchecked" title="as_chunks_unchecked">as_chunks_unchecked</a></li><li><a href="#method.as_flattened" title="as_flattened">as_flattened</a></li><li><a href="#method.as_ptr" title="as_ptr">as_ptr</a></li><li><a href="#method.as_ptr_range" title="as_ptr_range">as_ptr_range</a></li><li><a href="#method.as_rchunks" title="as_rchunks">as_rchunks</a></li><li><a href="#method.as_simd" title="as_simd">as_simd</a></li><li><a href="#method.as_str" title="as_str">as_str</a></li><li><a href="#method.binary_search" title="binary_search">binary_search</a></li><li><a href="#method.binary_search_by" title="binary_search_by">binary_search_by</a></li><li><a href="#method.binary_search_by_key" title="binary_search_by_key">binary_search_by_key</a></li><li><a href="#method.chunk_by" title="chunk_by">chunk_by</a></li><li><a href="#method.chunks" title="chunks">chunks</a></li><li><a href="#method.chunks_exact" title="chunks_exact">chunks_exact</a></li><li><a href="#method.concat" title="concat">concat</a></li><li><a href="#method.connect" title="connect">connect</a></li><li><a href="#method.contains" title="contains">contains</a></li><li><a href="#method.elem_offset" title="elem_offset">elem_offset</a></li><li><a href="#method.ends_with" title="ends_with">ends_with</a></li><li><a href="#method.eq_ignore_ascii_case" title="eq_ignore_ascii_case">eq_ignore_ascii_case</a></li><li><a href="#method.escape_ascii" title="escape_ascii">escape_ascii</a></li><li><a href="#method.first" title="first">first</a></li><li><a href="#method.first_chunk" title="first_chunk">first_chunk</a></li><li><a href="#method.get" title="get">get</a></li><li><a href="#method.get_unchecked" title="get_unchecked">get_unchecked</a></li><li><a href="#method.is_ascii" title="is_ascii">is_ascii</a></li><li><a href="#method.is_empty-1" title="is_empty">is_empty</a></li><li><a href="#method.is_sorted" title="is_sorted">is_sorted</a></li><li><a href="#method.is_sorted_by" title="is_sorted_by">is_sorted_by</a></li><li><a href="#method.is_sorted_by_key" title="is_sorted_by_key">is_sorted_by_key</a></li><li><a href="#method.iter" title="iter">iter</a></li><li><a href="#method.join" title="join">join</a></li><li><a href="#method.last" title="last">last</a></li><li><a href="#method.last_chunk" title="last_chunk">last_chunk</a></li><li><a href="#method.len-1" title="len">len</a></li><li><a href="#method.partition_point" title="partition_point">partition_point</a></li><li><a href="#method.rchunks" title="rchunks">rchunks</a></li><li><a href="#method.rchunks_exact" title="rchunks_exact">rchunks_exact</a></li><li><a href="#method.repeat" title="repeat">repeat</a></li><li><a href="#method.rsplit" title="rsplit">rsplit</a></li><li><a href="#method.rsplit_once" title="rsplit_once">rsplit_once</a></li><li><a href="#method.rsplitn" title="rsplitn">rsplitn</a></li><li><a href="#method.split" title="split">split</a></li><li><a href="#method.split_at" title="split_at">split_at</a></li><li><a href="#method.split_at_checked" title="split_at_checked">split_at_checked</a></li><li><a href="#method.split_at_unchecked" title="split_at_unchecked">split_at_unchecked</a></li><li><a href="#method.split_first" title="split_first">split_first</a></li><li><a href="#method.split_first_chunk" title="split_first_chunk">split_first_chunk</a></li><li><a href="#method.split_inclusive" title="split_inclusive">split_inclusive</a></li><li><a href="#method.split_last" title="split_last">split_last</a></li><li><a href="#method.split_last_chunk" title="split_last_chunk">split_last_chunk</a></li><li><a href="#method.split_once" title="split_once">split_once</a></li><li><a href="#method.splitn" title="splitn">splitn</a></li><li><a href="#method.starts_with" title="starts_with">starts_with</a></li><li><a href="#method.strip_prefix" title="strip_prefix">strip_prefix</a></li><li><a href="#method.strip_suffix" title="strip_suffix">strip_suffix</a></li><li><a href="#method.subslice_range" title="subslice_range">subslice_range</a></li><li><a href="#method.to_ascii_lowercase" title="to_ascii_lowercase">to_ascii_lowercase</a></li><li><a href="#method.to_ascii_uppercase" title="to_ascii_uppercase">to_ascii_uppercase</a></li><li><a href="#method.to_vec" title="to_vec">to_vec</a></li><li><a href="#method.to_vec_in" title="to_vec_in">to_vec_in</a></li><li><a href="#method.trim_ascii" title="trim_ascii">trim_ascii</a></li><li><a href="#method.trim_ascii_end" title="trim_ascii_end">trim_ascii_end</a></li><li><a href="#method.trim_ascii_start" title="trim_ascii_start">trim_ascii_start</a></li><li><a href="#method.utf8_chunks" title="utf8_chunks">utf8_chunks</a></li><li><a href="#method.windows" title="windows">windows</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AsRef%3C%5Bu8%5D%3E-for-SerializedSignature" title="AsRef&#60;[u8]&#62;">AsRef&#60;[u8]&#62;</a></li><li><a href="#impl-Borrow%3C%5Bu8%5D%3E-for-SerializedSignature" title="Borrow&#60;[u8]&#62;">Borrow&#60;[u8]&#62;</a></li><li><a href="#impl-Clone-for-SerializedSignature" title="Clone">Clone</a></li><li><a href="#impl-Copy-for-SerializedSignature" title="Copy">Copy</a></li><li><a href="#impl-Debug-for-SerializedSignature" title="Debug">Debug</a></li><li><a href="#impl-Deref-for-SerializedSignature" title="Deref">Deref</a></li><li><a href="#impl-Display-for-SerializedSignature" title="Display">Display</a></li><li><a href="#impl-Eq-for-SerializedSignature" title="Eq">Eq</a></li><li><a href="#impl-From%3C%26Signature%3E-for-SerializedSignature" title="From&#60;&#38;&#39;a Signature&#62;">From&#60;&#38;&#39;a Signature&#62;</a></li><li><a href="#impl-From%3CSignature%3E-for-SerializedSignature" title="From&#60;Signature&#62;">From&#60;Signature&#62;</a></li><li><a href="#impl-Hash-for-SerializedSignature" title="Hash">Hash</a></li><li><a href="#impl-IntoIterator-for-%26SerializedSignature" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-SerializedSignature" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-Ord-for-SerializedSignature" title="Ord">Ord</a></li><li><a href="#impl-PartialEq-for-SerializedSignature" title="PartialEq">PartialEq</a></li><li><a href="#impl-PartialEq%3CSerializedSignature%3E-for-%5Bu8%5D" title="PartialEq&#60;SerializedSignature&#62;">PartialEq&#60;SerializedSignature&#62;</a></li><li><a href="#impl-PartialEq%3C%5Bu8%5D%3E-for-SerializedSignature" title="PartialEq&#60;[u8]&#62;">PartialEq&#60;[u8]&#62;</a></li><li><a href="#impl-PartialOrd-for-SerializedSignature" title="PartialOrd">PartialOrd</a></li><li><a href="#impl-PartialOrd%3CSerializedSignature%3E-for-%5Bu8%5D" title="PartialOrd&#60;SerializedSignature&#62;">PartialOrd&#60;SerializedSignature&#62;</a></li><li><a href="#impl-PartialOrd%3C%5Bu8%5D%3E-for-SerializedSignature" title="PartialOrd&#60;[u8]&#62;">PartialOrd&#60;[u8]&#62;</a></li><li><a href="#impl-TryFrom%3C%26SerializedSignature%3E-for-Signature" title="TryFrom&#60;&#38;&#39;a SerializedSignature&#62;">TryFrom&#60;&#38;&#39;a SerializedSignature&#62;</a></li><li><a href="#impl-TryFrom%3CSerializedSignature%3E-for-Signature" title="TryFrom&#60;SerializedSignature&#62;">TryFrom&#60;SerializedSignature&#62;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-SerializedSignature" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-SerializedSignature" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-SerializedSignature" title="Send">Send</a></li><li><a href="#impl-Sync-for-SerializedSignature" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-SerializedSignature" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-SerializedSignature" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-Equivalent%3CK%3E-for-Q" title="Equivalent&#60;K&#62;">Equivalent&#60;K&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-Receiver-for-P" title="Receiver">Receiver</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-ToString-for-T" title="ToString">ToString</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li><li><a href="#impl-VZip%3CV%3E-for-T" title="VZip&#60;V&#62;">VZip&#60;V&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bdk_<wbr>chain::<wbr>bitcoin::<wbr>secp256k1::<wbr>ecdsa::<wbr>serialized_<wbr>signature</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../../../index.html">bdk_chain</a>::<wbr><a href="../../../index.html">bitcoin</a>::<wbr><a href="../../index.html">secp256k1</a>::<wbr><a href="../index.html">ecdsa</a>::<wbr><a href="index.html">serialized_signature</a></span><h1>Struct <span class="struct">SerializedSignature</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub struct SerializedSignature { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A DER serialized Signature</p>
2 </div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-SerializedSignature" class="impl"><a href="#impl-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.capacity" class="method"><h4 class="code-header">pub fn <a href="#method.capacity" class="fn">capacity</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: This always returns 72</span></div></span></summary><div class="docblock"><p>Get the capacity of the underlying data buffer.</p>
3 </div></details><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the len of the used data.</p>
4 </div></details><details class="toggle method-toggle" open><summary><section id="method.to_signature" class="method"><h4 class="code-header">pub fn <a href="#method.to_signature" class="fn">to_signature</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>, <a class="enum" href="../../enum.Error.html" title="enum bdk_chain::bitcoin::secp256k1::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Convert the serialized signature into the Signature struct.
5 (This DER deserializes it)</p>
6 </div></details><details class="toggle method-toggle" open><summary><section id="method.from_signature" class="method"><h4 class="code-header">pub fn <a href="#method.from_signature" class="fn">from_signature</a>(sig: &amp;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>) -&gt; <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h4></section></summary><div class="docblock"><p>Create a SerializedSignature from a Signature.
7 (this DER serializes it)</p>
8 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: This always returns false</span></div></span></summary><div class="docblock"><p>Check if the space is zero.</p>
9 </div></details></div></details></div><details class="toggle big-toggle" open><summary><h2 id="deref-methods-%5Bu8%5D" class="section-header"><span>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>&lt;Target = [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;</span><a href="#deref-methods-%5Bu8%5D" class="anchor">§</a></h2></summary><div id="deref-methods-%5Bu8%5D-1" class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_str" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/ascii/ascii_char.rs.html#564">Source</a><h4 class="code-header">pub fn <a href="#method.as_str" class="fn">as_str</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><div class="docblock"><p>Views this slice of ASCII characters as a UTF-8 <code>str</code>.</p>
10 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_bytes" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/ascii/ascii_char.rs.html#575">Source</a><h4 class="code-header">pub fn <a href="#method.as_bytes" class="fn">as_bytes</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><div class="docblock"><p>Views this slice of ASCII characters as a slice of <code>u8</code> bytes.</p>
11 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_ascii" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.23.0">1.23.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#16">Source</a></span><h4 class="code-header">pub fn <a href="#method.is_ascii" class="fn">is_ascii</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks if all bytes in this slice are within the ASCII range.</p>
12 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_ascii" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#25">Source</a><h4 class="code-header">pub fn <a href="#method.as_ascii" class="fn">as_ascii</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;[<a class="enum" href="https://doc.rust-lang.org/nightly/core/ascii/ascii_char/enum.AsciiChar.html" title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><div class="docblock"><p>If this slice <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_ascii" title="method slice::is_ascii"><code>is_ascii</code></a>, returns it as a slice of
13 <a href="https://doc.rust-lang.org/nightly/core/ascii/ascii_char/enum.AsciiChar.html" title="enum core::ascii::ascii_char::AsciiChar">ASCII characters</a>, otherwise returns <code>None</code>.</p>
14 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_ascii_unchecked" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#43">Source</a><h4 class="code-header">pub unsafe fn <a href="#method.as_ascii_unchecked" class="fn">as_ascii_unchecked</a>(&amp;self) -&gt; &amp;[<a class="enum" href="https://doc.rust-lang.org/nightly/core/ascii/ascii_char/enum.AsciiChar.html" title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><div class="docblock"><p>Converts this slice of bytes into a slice of ASCII characters,
15 without checking whether they’re valid.</p>
16 <h5 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h5>
17 <p>Every byte in the slice must be in <code>0..=127</code>, or else this is UB.</p>
18 </div></details><details class="toggle method-toggle" open><summary><section id="method.eq_ignore_ascii_case" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.23.0">1.23.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#58">Source</a></span><h4 class="code-header">pub fn <a href="#method.eq_ignore_ascii_case" class="fn">eq_ignore_ascii_case</a>(&amp;self, other: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that two slices are an ASCII case-insensitive match.</p>
19 <p>Same as <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>,
20 but without allocating and copying temporaries.</p>
21 </div></details><details class="toggle method-toggle" open><summary><section id="method.escape_ascii" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.60.0">1.60.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#139">Source</a></span><h4 class="code-header">pub fn <a href="#method.escape_ascii" class="fn">escape_ascii</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/ascii/struct.EscapeAscii.html" title="struct core::slice::ascii::EscapeAscii">EscapeAscii</a>&lt;'_&gt; <a href="#" class="tooltip" data-notable-ty="EscapeAscii&lt;&#39;_&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator that produces an escaped version of this slice,
22 treating it as an ASCII string.</p>
23 <h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
24 <div class="example-wrap"><pre class="rust rust-example-rendered"><code>
25 <span class="kw">let </span>s = <span class="string">b"0\t\r\n'\"\\\x9d"</span>;
26 <span class="kw">let </span>escaped = s.escape_ascii().to_string();
27 <span class="macro">assert_eq!</span>(escaped, <span class="string">"0\\t\\r\\n\\'\\\"\\\\\\x9d"</span>);</code></pre></div>
28 </div></details><details class="toggle method-toggle" open><summary><section id="method.trim_ascii_start" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#158">Source</a></span><h4 class="code-header">pub fn <a href="#method.trim_ascii_start" class="fn">trim_ascii_start</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns a byte slice with leading ASCII whitespace bytes removed.</p>
29 <p>‘Whitespace’ refers to the definition used by
30 <a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html#method.is_ascii_whitespace" title="method u8::is_ascii_whitespace"><code>u8::is_ascii_whitespace</code></a>.</p>
31 <h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
32 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">b" \t hello world\n"</span>.trim_ascii_start(), <span class="string">b"hello world\n"</span>);
33 <span class="macro">assert_eq!</span>(<span class="string">b" "</span>.trim_ascii_start(), <span class="string">b""</span>);
34 <span class="macro">assert_eq!</span>(<span class="string">b""</span>.trim_ascii_start(), <span class="string">b""</span>);</code></pre></div>
35 </div></details><details class="toggle method-toggle" open><summary><section id="method.trim_ascii_end" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#187">Source</a></span><h4 class="code-header">pub fn <a href="#method.trim_ascii_end" class="fn">trim_ascii_end</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns a byte slice with trailing ASCII whitespace bytes removed.</p>
36 <p>‘Whitespace’ refers to the definition used by
37 <a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html#method.is_ascii_whitespace" title="method u8::is_ascii_whitespace"><code>u8::is_ascii_whitespace</code></a>.</p>
38 <h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
39 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">b"\r hello world\n "</span>.trim_ascii_end(), <span class="string">b"\r hello world"</span>);
40 <span class="macro">assert_eq!</span>(<span class="string">b" "</span>.trim_ascii_end(), <span class="string">b""</span>);
41 <span class="macro">assert_eq!</span>(<span class="string">b""</span>.trim_ascii_end(), <span class="string">b""</span>);</code></pre></div>
42 </div></details><details class="toggle method-toggle" open><summary><section id="method.trim_ascii" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/ascii.rs.html#217">Source</a></span><h4 class="code-header">pub fn <a href="#method.trim_ascii" class="fn">trim_ascii</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns a byte slice with leading and trailing ASCII whitespace bytes
43 removed.</p>
44 <p>‘Whitespace’ refers to the definition used by
45 <a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html#method.is_ascii_whitespace" title="method u8::is_ascii_whitespace"><code>u8::is_ascii_whitespace</code></a>.</p>
46 <h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
47 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">b"\r hello world\n "</span>.trim_ascii(), <span class="string">b"hello world"</span>);
48 <span class="macro">assert_eq!</span>(<span class="string">b" "</span>.trim_ascii(), <span class="string">b""</span>);
49 <span class="macro">assert_eq!</span>(<span class="string">b""</span>.trim_ascii(), <span class="string">b""</span>);</code></pre></div>
50 </div></details><details class="toggle method-toggle" open><summary><section id="method.len-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#117">Source</a></span><h4 class="code-header">pub fn <a href="#method.len-1" class="fn">len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of elements in the slice.</p>
51 <h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
52 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>a = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
53 <span class="macro">assert_eq!</span>(a.len(), <span class="number">3</span>);</code></pre></div>
54 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#136">Source</a></span><h4 class="code-header">pub fn <a href="#method.is_empty-1" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the slice has a length of 0.</p>
55 <h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
56 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>a = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
57 <span class="macro">assert!</span>(!a.is_empty());
58
59 <span class="kw">let </span>b: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[];
60 <span class="macro">assert!</span>(b.is_empty());</code></pre></div>
61 </div></details><details class="toggle method-toggle" open><summary><section id="method.first" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#155">Source</a></span><h4 class="code-header">pub fn <a href="#method.first" class="fn">first</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the first element of the slice, or <code>None</code> if it is empty.</p>
62 <h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
63 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
64 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">10</span>), v.first());
65
66 <span class="kw">let </span>w: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[];
67 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, w.first());</code></pre></div>
68 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_first" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#198">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_first" class="fn">split_first</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)&gt;</h4></section></summary><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>
69 <h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
70 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>];
71
72 <span class="kw">if let </span><span class="prelude-val">Some</span>((first, elements)) = x.split_first() {
73 <span class="macro">assert_eq!</span>(first, <span class="kw-2">&amp;</span><span class="number">0</span>);
74 <span class="macro">assert_eq!</span>(elements, <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>]);
75 }</code></pre></div>
76 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_last" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#240">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_last" class="fn">split_last</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)&gt;</h4></section></summary><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>
77 <h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
78 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>];
79
80 <span class="kw">if let </span><span class="prelude-val">Some</span>((last, elements)) = x.split_last() {
81 <span class="macro">assert_eq!</span>(last, <span class="kw-2">&amp;</span><span class="number">2</span>);
82 <span class="macro">assert_eq!</span>(elements, <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>]);
83 }</code></pre></div>
84 </div></details><details class="toggle method-toggle" open><summary><section id="method.last" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#281">Source</a></span><h4 class="code-header">pub fn <a href="#method.last" class="fn">last</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the last element of the slice, or <code>None</code> if it is empty.</p>
85 <h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
86 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
87 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">30</span>), v.last());
88
89 <span class="kw">let </span>w: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[];
90 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, w.last());</code></pre></div>
91 </div></details><details class="toggle method-toggle" open><summary><section id="method.first_chunk" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.77.0">1.77.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#327">Source</a></span><h4 class="code-header">pub fn <a href="#method.first_chunk" class="fn">first_chunk</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>&gt;</h4></section></summary><div class="docblock"><p>Returns an array reference to the first <code>N</code> items in the slice.</p>
92 <p>If the slice is not at least <code>N</code> in length, this will return <code>None</code>.</p>
93 <h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
94 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>u = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
95 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>]), u.first_chunk::&lt;<span class="number">2</span>&gt;());
96
97 <span class="kw">let </span>v: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[<span class="number">10</span>];
98 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, v.first_chunk::&lt;<span class="number">2</span>&gt;());
99
100 <span class="kw">let </span>w: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[];
101 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[]), w.first_chunk::&lt;<span class="number">0</span>&gt;());</code></pre></div>
102 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_first_chunk" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.77.0">1.77.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#387">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_first_chunk" class="fn">split_first_chunk</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)&gt;</h4></section></summary><div class="docblock"><p>Returns an array reference to the first <code>N</code> items in the slice and the remaining slice.</p>
103 <p>If the slice is not at least <code>N</code> in length, this will return <code>None</code>.</p>
104 <h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
105 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>];
106
107 <span class="kw">if let </span><span class="prelude-val">Some</span>((first, elements)) = x.split_first_chunk::&lt;<span class="number">2</span>&gt;() {
108 <span class="macro">assert_eq!</span>(first, <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>]);
109 <span class="macro">assert_eq!</span>(elements, <span class="kw-2">&amp;</span>[<span class="number">2</span>]);
110 }
111
112 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, x.split_first_chunk::&lt;<span class="number">4</span>&gt;());</code></pre></div>
113 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_last_chunk" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.77.0">1.77.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#457">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_last_chunk" class="fn">split_last_chunk</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>)&gt;</h4></section></summary><div class="docblock"><p>Returns an array reference to the last <code>N</code> items in the slice and the remaining slice.</p>
114 <p>If the slice is not at least <code>N</code> in length, this will return <code>None</code>.</p>
115 <h5 id="examples-12"><a class="doc-anchor" href="#examples-12">§</a>Examples</h5>
116 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>];
117
118 <span class="kw">if let </span><span class="prelude-val">Some</span>((elements, last)) = x.split_last_chunk::&lt;<span class="number">2</span>&gt;() {
119 <span class="macro">assert_eq!</span>(elements, <span class="kw-2">&amp;</span>[<span class="number">0</span>]);
120 <span class="macro">assert_eq!</span>(last, <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>]);
121 }
122
123 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, x.split_last_chunk::&lt;<span class="number">4</span>&gt;());</code></pre></div>
124 </div></details><details class="toggle method-toggle" open><summary><section id="method.last_chunk" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.77.0">1.77.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#527">Source</a></span><h4 class="code-header">pub fn <a href="#method.last_chunk" class="fn">last_chunk</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>&gt;</h4></section></summary><div class="docblock"><p>Returns an array reference to the last <code>N</code> items in the slice.</p>
125 <p>If the slice is not at least <code>N</code> in length, this will return <code>None</code>.</p>
126 <h5 id="examples-13"><a class="doc-anchor" href="#examples-13">§</a>Examples</h5>
127 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>u = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
128 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">40</span>, <span class="number">30</span>]), u.last_chunk::&lt;<span class="number">2</span>&gt;());
129
130 <span class="kw">let </span>v: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[<span class="number">10</span>];
131 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, v.last_chunk::&lt;<span class="number">2</span>&gt;());
132
133 <span class="kw">let </span>w: <span class="kw-2">&amp;</span>[i32] = <span class="kw-2">&amp;</span>[];
134 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[]), w.last_chunk::&lt;<span class="number">0</span>&gt;());</code></pre></div>
135 </div></details><details class="toggle method-toggle" open><summary><section id="method.get" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#596-598">Source</a></span><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a>&lt;I&gt;(&amp;self, index: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html#associatedtype.Output" title="type core::slice::index::SliceIndex::Output">Output</a>&gt;<div class="where">where
136 I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Returns a reference to an element or subslice depending on the type of
137 index.</p>
138 <ul>
139 <li>If given a position, returns a reference to the element at that
140 position or <code>None</code> if out of bounds.</li>
141 <li>If given a range, returns the subslice corresponding to that range,
142 or <code>None</code> if out of bounds.</li>
143 </ul>
144 <h5 id="examples-14"><a class="doc-anchor" href="#examples-14">§</a>Examples</h5>
145 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
146 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">40</span>), v.get(<span class="number">1</span>));
147 <span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>][..]), v.get(<span class="number">0</span>..<span class="number">2</span>));
148 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, v.get(<span class="number">3</span>));
149 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, v.get(<span class="number">0</span>..<span class="number">4</span>));</code></pre></div>
150 </div></details><details class="toggle method-toggle" open><summary><section id="method.get_unchecked" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#658-660">Source</a></span><h4 class="code-header">pub unsafe fn <a href="#method.get_unchecked" class="fn">get_unchecked</a>&lt;I&gt;(
151 &amp;self,
152 index: I,
153 ) -&gt; &amp;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html#associatedtype.Output" title="type core::slice::index::SliceIndex::Output">Output</a><div class="where">where
154 I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Returns a reference to an element or subslice, without doing bounds
155 checking.</p>
156 <p>For a safe alternative see <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.get" title="method slice::get"><code>get</code></a>.</p>
157 <h5 id="safety-1"><a class="doc-anchor" href="#safety-1">§</a>Safety</h5>
158 <p>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>
159 even if the resulting reference is not used.</p>
160 <p>You can think of this like <code>.get(index).unwrap_unchecked()</code>. It’s UB
161 to call <code>.get_unchecked(len)</code>, even if you immediately convert to a
162 pointer. And it’s UB to call <code>.get_unchecked(..len + 1)</code>,
163 <code>.get_unchecked(..=len)</code>, or similar.</p>
164 <h5 id="examples-15"><a class="doc-anchor" href="#examples-15">§</a>Examples</h5>
165 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">4</span>];
166
167 <span class="kw">unsafe </span>{
168 <span class="macro">assert_eq!</span>(x.get_unchecked(<span class="number">1</span>), <span class="kw-2">&amp;</span><span class="number">2</span>);
169 }</code></pre></div>
170 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_ptr" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#742">Source</a></span><h4 class="code-header">pub fn <a href="#method.as_ptr" class="fn">as_ptr</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a></h4></section></summary><div class="docblock"><p>Returns a raw pointer to the slice’s buffer.</p>
171 <p>The caller must ensure that the slice outlives the pointer this
172 function returns, or else it will end up dangling.</p>
173 <p>The caller must also ensure that the memory the pointer (non-transitively) points to
174 is never written to (except inside an <code>UnsafeCell</code>) using this pointer or any pointer
175 derived from it. If you need to mutate the contents of the slice, use <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_mut_ptr" title="method slice::as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
176 <p>Modifying the container referenced by this slice may cause its buffer
177 to be reallocated, which would also make any pointers to it invalid.</p>
178 <h5 id="examples-16"><a class="doc-anchor" href="#examples-16">§</a>Examples</h5>
179 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">4</span>];
180 <span class="kw">let </span>x_ptr = x.as_ptr();
181
182 <span class="kw">unsafe </span>{
183 <span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..x.len() {
184 <span class="macro">assert_eq!</span>(x.get_unchecked(i), <span class="kw-2">&amp;*</span>x_ptr.add(i));
185 }
186 }</code></pre></div>
187 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_ptr_range" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.48.0">1.48.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#809">Source</a></span><h4 class="code-header">pub fn <a href="#method.as_ptr_range" class="fn">as_ptr_range</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a>&gt; <a href="#" class="tooltip" data-notable-ty="Range&lt;*const T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns the two raw pointers spanning the slice.</p>
188 <p>The returned range is half-open, which means that the end pointer
189 points <em>one past</em> the last element of the slice. This way, an empty
190 slice is represented by two equal pointers, and the difference between
191 the two pointers represents the size of the slice.</p>
192 <p>See <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_ptr" title="method slice::as_ptr"><code>as_ptr</code></a> for warnings on using these pointers. The end pointer
193 requires extra caution, as it does not point to a valid element in the
194 slice.</p>
195 <p>This function is useful for interacting with foreign interfaces which
196 use two pointers to refer to a range of elements in memory, as is
197 common in C++.</p>
198 <p>It can also be useful to check if a pointer to an element refers to an
199 element of this slice:</p>
200
201 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>a = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
202 <span class="kw">let </span>x = <span class="kw-2">&amp;</span>a[<span class="number">1</span>] <span class="kw">as </span><span class="kw-2">*const </span><span class="kw">_</span>;
203 <span class="kw">let </span>y = <span class="kw-2">&amp;</span><span class="number">5 </span><span class="kw">as </span><span class="kw-2">*const </span><span class="kw">_</span>;
204
205 <span class="macro">assert!</span>(a.as_ptr_range().contains(<span class="kw-2">&amp;</span>x));
206 <span class="macro">assert!</span>(!a.as_ptr_range().contains(<span class="kw-2">&amp;</span>y));</code></pre></div>
207 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_array" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#865">Source</a><h4 class="code-header">pub fn <a href="#method.as_array" class="fn">as_array</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_array</code>)</span></div></span></summary><div class="docblock"><p>Gets a reference to the underlying array.</p>
208 <p>If <code>N</code> is not exactly equal to the length of <code>self</code>, then this method returns <code>None</code>.</p>
209 </div></details><details class="toggle method-toggle" open><summary><section id="method.iter" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1050">Source</a></span><h4 class="code-header">pub fn <a href="#method.iter" class="fn">iter</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.Iter.html" title="struct core::slice::iter::Iter">Iter</a>&lt;'_, T&gt; <a href="#" class="tooltip" data-notable-ty="Iter&lt;&#39;_, T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator over the slice.</p>
210 <p>The iterator yields all items from start to end.</p>
211 <h5 id="examples-17"><a class="doc-anchor" href="#examples-17">§</a>Examples</h5>
212 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">4</span>];
213 <span class="kw">let </span><span class="kw-2">mut </span>iterator = x.iter();
214
215 <span class="macro">assert_eq!</span>(iterator.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">1</span>));
216 <span class="macro">assert_eq!</span>(iterator.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">2</span>));
217 <span class="macro">assert_eq!</span>(iterator.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">4</span>));
218 <span class="macro">assert_eq!</span>(iterator.next(), <span class="prelude-val">None</span>);</code></pre></div>
219 </div></details><details class="toggle method-toggle" open><summary><section id="method.windows" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1118">Source</a></span><h4 class="code-header">pub fn <a href="#method.windows" class="fn">windows</a>(&amp;self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.Windows.html" title="struct core::slice::iter::Windows">Windows</a>&lt;'_, T&gt; <a href="#" class="tooltip" data-notable-ty="Windows&lt;&#39;_, T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator over all contiguous windows of length
220 <code>size</code>. The windows overlap. If the slice is shorter than
221 <code>size</code>, the iterator returns no values.</p>
222 <h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
223 <p>Panics if <code>size</code> is zero.</p>
224 <h5 id="examples-18"><a class="doc-anchor" href="#examples-18">§</a>Examples</h5>
225 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<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>];
226 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.windows(<span class="number">3</span>);
227 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'l'</span>, <span class="string">'o'</span>, <span class="string">'r'</span>]);
228 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'o'</span>, <span class="string">'r'</span>, <span class="string">'e'</span>]);
229 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'r'</span>, <span class="string">'e'</span>, <span class="string">'m'</span>]);
230 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
231 <p>If the slice is shorter than <code>size</code>:</p>
232
233 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<span class="string">'f'</span>, <span class="string">'o'</span>, <span class="string">'o'</span>];
234 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.windows(<span class="number">4</span>);
235 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
236 <p>There’s no <code>windows_mut</code>, as that existing would let safe code violate the
237 “only one <code>&amp;mut</code> at a time to the same thing” rule. However, you can sometimes
238 use <a href="https://doc.rust-lang.org/nightly/core/cell/struct.Cell.html#method.as_slice_of_cells" title="method core::cell::Cell::as_slice_of_cells"><code>Cell::as_slice_of_cells</code></a> in
239 conjunction with <code>windows</code> to accomplish something similar:</p>
240
241 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::cell::Cell;
242
243 <span class="kw">let </span><span class="kw-2">mut </span>array = [<span class="string">'R'</span>, <span class="string">'u'</span>, <span class="string">'s'</span>, <span class="string">'t'</span>, <span class="string">' '</span>, <span class="string">'2'</span>, <span class="string">'0'</span>, <span class="string">'1'</span>, <span class="string">'5'</span>];
244 <span class="kw">let </span>slice = <span class="kw-2">&amp;mut </span>array[..];
245 <span class="kw">let </span>slice_of_cells: <span class="kw-2">&amp;</span>[Cell&lt;char&gt;] = Cell::from_mut(slice).as_slice_of_cells();
246 <span class="kw">for </span>w <span class="kw">in </span>slice_of_cells.windows(<span class="number">3</span>) {
247 Cell::swap(<span class="kw-2">&amp;</span>w[<span class="number">0</span>], <span class="kw-2">&amp;</span>w[<span class="number">2</span>]);
248 }
249 <span class="macro">assert_eq!</span>(array, [<span class="string">'s'</span>, <span class="string">'t'</span>, <span class="string">' '</span>, <span class="string">'2'</span>, <span class="string">'0'</span>, <span class="string">'1'</span>, <span class="string">'5'</span>, <span class="string">'u'</span>, <span class="string">'R'</span>]);</code></pre></div>
250 </div></details><details class="toggle method-toggle" open><summary><section id="method.chunks" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1153">Source</a></span><h4 class="code-header">pub fn <a href="#method.chunks" class="fn">chunks</a>(&amp;self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.Chunks.html" title="struct core::slice::iter::Chunks">Chunks</a>&lt;'_, T&gt; <a href="#" class="tooltip" data-notable-ty="Chunks&lt;&#39;_, T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
251 beginning of the slice.</p>
252 <p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
253 slice, then the last chunk will not have length <code>chunk_size</code>.</p>
254 <p>See <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.chunks_exact" title="method slice::chunks_exact"><code>chunks_exact</code></a> for a variant of this iterator that returns chunks of always exactly
255 <code>chunk_size</code> elements, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.rchunks" title="method slice::rchunks"><code>rchunks</code></a> for the same iterator but starting at the end of the
256 slice.</p>
257 <h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
258 <p>Panics if <code>chunk_size</code> is zero.</p>
259 <h5 id="examples-19"><a class="doc-anchor" href="#examples-19">§</a>Examples</h5>
260 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<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>];
261 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.chunks(<span class="number">2</span>);
262 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'l'</span>, <span class="string">'o'</span>]);
263 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'r'</span>, <span class="string">'e'</span>]);
264 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'m'</span>]);
265 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
266 </div></details><details class="toggle method-toggle" open><summary><section id="method.chunks_exact" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.31.0">1.31.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1230">Source</a></span><h4 class="code-header">pub fn <a href="#method.chunks_exact" class="fn">chunks_exact</a>(&amp;self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.ChunksExact.html" title="struct core::slice::iter::ChunksExact">ChunksExact</a>&lt;'_, T&gt; <a href="#" class="tooltip" data-notable-ty="ChunksExact&lt;&#39;_, T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
267 beginning of the slice.</p>
268 <p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
269 slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be retrieved
270 from the <code>remainder</code> function of the iterator.</p>
271 <p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
272 resulting code better than in the case of <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.chunks" title="method slice::chunks"><code>chunks</code></a>.</p>
273 <p>See <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.chunks" title="method slice::chunks"><code>chunks</code></a> for a variant of this iterator that also returns the remainder as a smaller
274 chunk, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.rchunks_exact" title="method slice::rchunks_exact"><code>rchunks_exact</code></a> for the same iterator but starting at the end of the slice.</p>
275 <h5 id="panics-2"><a class="doc-anchor" href="#panics-2">§</a>Panics</h5>
276 <p>Panics if <code>chunk_size</code> is zero.</p>
277 <h5 id="examples-20"><a class="doc-anchor" href="#examples-20">§</a>Examples</h5>
278 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<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>];
279 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.chunks_exact(<span class="number">2</span>);
280 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'l'</span>, <span class="string">'o'</span>]);
281 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'r'</span>, <span class="string">'e'</span>]);
282 <span class="macro">assert!</span>(iter.next().is_none());
283 <span class="macro">assert_eq!</span>(iter.remainder(), <span class="kw-2">&amp;</span>[<span class="string">'m'</span>]);</code></pre></div>
284 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_chunks_unchecked" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1309">Source</a><h4 class="code-header">pub unsafe fn <a href="#method.as_chunks_unchecked" class="fn">as_chunks_unchecked</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>]</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><div class="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
285 assuming that there’s no remainder.</p>
286 <h5 id="safety-2"><a class="doc-anchor" href="#safety-2">§</a>Safety</h5>
287 <p>This may only be called when</p>
288 <ul>
289 <li>The slice splits exactly into <code>N</code>-element chunks (aka <code>self.len() % N == 0</code>).</li>
290 <li><code>N != 0</code>.</li>
291 </ul>
292 <h5 id="examples-21"><a class="doc-anchor" href="#examples-21">§</a>Examples</h5>
293 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(slice_as_chunks)]
294 </span><span class="kw">let </span>slice: <span class="kw-2">&amp;</span>[char] = <span class="kw-2">&amp;</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="string">'!'</span>];
295 <span class="kw">let </span>chunks: <span class="kw-2">&amp;</span>[[char; <span class="number">1</span>]] =
296 <span class="comment">// SAFETY: 1-element chunks never have remainder
297 </span><span class="kw">unsafe </span>{ slice.as_chunks_unchecked() };
298 <span class="macro">assert_eq!</span>(chunks, <span class="kw-2">&amp;</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="string">'!'</span>]]);
299 <span class="kw">let </span>chunks: <span class="kw-2">&amp;</span>[[char; <span class="number">3</span>]] =
300 <span class="comment">// SAFETY: The slice length (6) is a multiple of 3
301 </span><span class="kw">unsafe </span>{ slice.as_chunks_unchecked() };
302 <span class="macro">assert_eq!</span>(chunks, <span class="kw-2">&amp;</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="string">'!'</span>]]);
303
304 <span class="comment">// These would be unsound:
305 // let chunks: &amp;[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
306 // let chunks: &amp;[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed</span></code></pre></div>
307 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_chunks" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1356">Source</a><h4 class="code-header">pub fn <a href="#method.as_chunks" class="fn">as_chunks</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; (&amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>], &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><div class="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
308 starting at the beginning of the slice,
309 and a remainder slice with length strictly less than <code>N</code>.</p>
310 <h5 id="panics-3"><a class="doc-anchor" href="#panics-3">§</a>Panics</h5>
311 <p>Panics if <code>N</code> is zero. This check will most probably get changed to a compile time
312 error before this method gets stabilized.</p>
313 <h5 id="examples-22"><a class="doc-anchor" href="#examples-22">§</a>Examples</h5>
314 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(slice_as_chunks)]
315 </span><span class="kw">let </span>slice = [<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>];
316 <span class="kw">let </span>(chunks, remainder) = slice.as_chunks();
317 <span class="macro">assert_eq!</span>(chunks, <span class="kw-2">&amp;</span>[[<span class="string">'l'</span>, <span class="string">'o'</span>], [<span class="string">'r'</span>, <span class="string">'e'</span>]]);
318 <span class="macro">assert_eq!</span>(remainder, <span class="kw-2">&amp;</span>[<span class="string">'m'</span>]);</code></pre></div>
319 <p>If you expect the slice to be an exact multiple, you can combine
320 <code>let</code>-<code>else</code> with an empty slice pattern:</p>
321
322 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(slice_as_chunks)]
323 </span><span class="kw">let </span>slice = [<span class="string">'R'</span>, <span class="string">'u'</span>, <span class="string">'s'</span>, <span class="string">'t'</span>];
324 <span class="kw">let </span>(chunks, []) = slice.as_chunks::&lt;<span class="number">2</span>&gt;() <span class="kw">else </span>{
325 <span class="macro">panic!</span>(<span class="string">"slice didn't have even length"</span>)
326 };
327 <span class="macro">assert_eq!</span>(chunks, <span class="kw-2">&amp;</span>[[<span class="string">'R'</span>, <span class="string">'u'</span>], [<span class="string">'s'</span>, <span class="string">'t'</span>]]);</code></pre></div>
328 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_rchunks" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1391">Source</a><h4 class="code-header">pub fn <a href="#method.as_rchunks" class="fn">as_rchunks</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; (&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>])</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><div class="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
329 starting at the end of the slice,
330 and a remainder slice with length strictly less than <code>N</code>.</p>
331 <h5 id="panics-4"><a class="doc-anchor" href="#panics-4">§</a>Panics</h5>
332 <p>Panics if <code>N</code> is zero. This check will most probably get changed to a compile time
333 error before this method gets stabilized.</p>
334 <h5 id="examples-23"><a class="doc-anchor" href="#examples-23">§</a>Examples</h5>
335 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(slice_as_chunks)]
336 </span><span class="kw">let </span>slice = [<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>];
337 <span class="kw">let </span>(remainder, chunks) = slice.as_rchunks();
338 <span class="macro">assert_eq!</span>(remainder, <span class="kw-2">&amp;</span>[<span class="string">'l'</span>]);
339 <span class="macro">assert_eq!</span>(chunks, <span class="kw-2">&amp;</span>[[<span class="string">'o'</span>, <span class="string">'r'</span>], [<span class="string">'e'</span>, <span class="string">'m'</span>]]);</code></pre></div>
340 </div></details><details class="toggle method-toggle" open><summary><section id="method.array_chunks" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1431">Source</a><h4 class="code-header">pub fn <a href="#method.array_chunks" class="fn">array_chunks</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.ArrayChunks.html" title="struct core::slice::iter::ArrayChunks">ArrayChunks</a>&lt;'_, T, N&gt; <a href="#" class="tooltip" data-notable-ty="ArrayChunks&lt;&#39;_, T, N&gt;">ⓘ</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>array_chunks</code>)</span></div></span></summary><div class="docblock"><p>Returns an iterator over <code>N</code> elements of the slice at a time, starting at the
341 beginning of the slice.</p>
342 <p>The chunks are array references and do not overlap. If <code>N</code> does not divide the
343 length of the slice, then the last up to <code>N-1</code> elements will be omitted and can be
344 retrieved from the <code>remainder</code> function of the iterator.</p>
345 <p>This method is the const generic equivalent of <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.chunks_exact" title="method slice::chunks_exact"><code>chunks_exact</code></a>.</p>
346 <h5 id="panics-5"><a class="doc-anchor" href="#panics-5">§</a>Panics</h5>
347 <p>Panics if <code>N</code> is zero. This check will most probably get changed to a compile time
348 error before this method gets stabilized.</p>
349 <h5 id="examples-24"><a class="doc-anchor" href="#examples-24">§</a>Examples</h5>
350 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(array_chunks)]
351 </span><span class="kw">let </span>slice = [<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>];
352 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.array_chunks();
353 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'l'</span>, <span class="string">'o'</span>]);
354 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'r'</span>, <span class="string">'e'</span>]);
355 <span class="macro">assert!</span>(iter.next().is_none());
356 <span class="macro">assert_eq!</span>(iter.remainder(), <span class="kw-2">&amp;</span>[<span class="string">'m'</span>]);</code></pre></div>
357 </div></details><details class="toggle method-toggle" open><summary><section id="method.array_windows" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1627">Source</a><h4 class="code-header">pub fn <a href="#method.array_windows" class="fn">array_windows</a>&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.ArrayWindows.html" title="struct core::slice::iter::ArrayWindows">ArrayWindows</a>&lt;'_, T, N&gt; <a href="#" class="tooltip" data-notable-ty="ArrayWindows&lt;&#39;_, T, N&gt;">ⓘ</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>array_windows</code>)</span></div></span></summary><div class="docblock"><p>Returns an iterator over overlapping windows of <code>N</code> elements of a slice,
358 starting at the beginning of the slice.</p>
359 <p>This is the const generic equivalent of <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.windows" title="method slice::windows"><code>windows</code></a>.</p>
360 <p>If <code>N</code> is greater than the size of the slice, it will return no windows.</p>
361 <h5 id="panics-6"><a class="doc-anchor" href="#panics-6">§</a>Panics</h5>
362 <p>Panics if <code>N</code> is zero. This check will most probably get changed to a compile time
363 error before this method gets stabilized.</p>
364 <h5 id="examples-25"><a class="doc-anchor" href="#examples-25">§</a>Examples</h5>
365 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(array_windows)]
366 </span><span class="kw">let </span>slice = [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
367 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.array_windows();
368 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>]);
369 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>]);
370 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">2</span>, <span class="number">3</span>]);
371 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
372 </div></details><details class="toggle method-toggle" open><summary><section id="method.rchunks" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.31.0">1.31.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1662">Source</a></span><h4 class="code-header">pub fn <a href="#method.rchunks" class="fn">rchunks</a>(&amp;self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.RChunks.html" title="struct core::slice::iter::RChunks">RChunks</a>&lt;'_, T&gt; <a href="#" class="tooltip" data-notable-ty="RChunks&lt;&#39;_, T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the end
373 of the slice.</p>
374 <p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
375 slice, then the last chunk will not have length <code>chunk_size</code>.</p>
376 <p>See <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.rchunks_exact" title="method slice::rchunks_exact"><code>rchunks_exact</code></a> for a variant of this iterator that returns chunks of always exactly
377 <code>chunk_size</code> elements, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.chunks" title="method slice::chunks"><code>chunks</code></a> for the same iterator but starting at the beginning
378 of the slice.</p>
379 <h5 id="panics-7"><a class="doc-anchor" href="#panics-7">§</a>Panics</h5>
380 <p>Panics if <code>chunk_size</code> is zero.</p>
381 <h5 id="examples-26"><a class="doc-anchor" href="#examples-26">§</a>Examples</h5>
382 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<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>];
383 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.rchunks(<span class="number">2</span>);
384 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'e'</span>, <span class="string">'m'</span>]);
385 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'o'</span>, <span class="string">'r'</span>]);
386 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'l'</span>]);
387 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
388 </div></details><details class="toggle method-toggle" open><summary><section id="method.rchunks_exact" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.31.0">1.31.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1741">Source</a></span><h4 class="code-header">pub fn <a href="#method.rchunks_exact" class="fn">rchunks_exact</a>(&amp;self, chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.RChunksExact.html" title="struct core::slice::iter::RChunksExact">RChunksExact</a>&lt;'_, T&gt; <a href="#" class="tooltip" data-notable-ty="RChunksExact&lt;&#39;_, T&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
389 end of the slice.</p>
390 <p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
391 slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be retrieved
392 from the <code>remainder</code> function of the iterator.</p>
393 <p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
394 resulting code better than in the case of <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.rchunks" title="method slice::rchunks"><code>rchunks</code></a>.</p>
395 <p>See <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.rchunks" title="method slice::rchunks"><code>rchunks</code></a> for a variant of this iterator that also returns the remainder as a smaller
396 chunk, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.chunks_exact" title="method slice::chunks_exact"><code>chunks_exact</code></a> for the same iterator but starting at the beginning of the
397 slice.</p>
398 <h5 id="panics-8"><a class="doc-anchor" href="#panics-8">§</a>Panics</h5>
399 <p>Panics if <code>chunk_size</code> is zero.</p>
400 <h5 id="examples-27"><a class="doc-anchor" href="#examples-27">§</a>Examples</h5>
401 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<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>];
402 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.rchunks_exact(<span class="number">2</span>);
403 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'e'</span>, <span class="string">'m'</span>]);
404 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="string">'o'</span>, <span class="string">'r'</span>]);
405 <span class="macro">assert!</span>(iter.next().is_none());
406 <span class="macro">assert_eq!</span>(iter.remainder(), <span class="kw-2">&amp;</span>[<span class="string">'l'</span>]);</code></pre></div>
407 </div></details><details class="toggle method-toggle" open><summary><section id="method.chunk_by" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.77.0">1.77.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1824-1826">Source</a></span><h4 class="code-header">pub fn <a href="#method.chunk_by" class="fn">chunk_by</a>&lt;F&gt;(&amp;self, pred: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.ChunkBy.html" title="struct core::slice::iter::ChunkBy">ChunkBy</a>&lt;'_, T, F&gt; <a href="#" class="tooltip" data-notable-ty="ChunkBy&lt;&#39;_, T, F&gt;">ⓘ</a><div class="where">where
408 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">&amp;T</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over the slice producing non-overlapping runs
409 of elements using the predicate to separate them.</p>
410 <p>The predicate is called for every pair of consecutive elements,
411 meaning that it is called on <code>slice[0]</code> and <code>slice[1]</code>,
412 followed by <code>slice[1]</code> and <code>slice[2]</code>, and so on.</p>
413 <h5 id="examples-28"><a class="doc-anchor" href="#examples-28">§</a>Examples</h5>
414 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">3</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">2</span>, <span class="number">2</span>];
415
416 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.chunk_by(|a, b| a == b);
417
418 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>][..]));
419 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">3</span>, <span class="number">3</span>][..]));
420 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">2</span>, <span class="number">2</span>, <span class="number">2</span>][..]));
421 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">None</span>);</code></pre></div>
422 <p>This method can be used to extract the sorted subslices:</p>
423
424 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>];
425
426 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.chunk_by(|a, b| a &lt;= b);
427
428 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>][..]));
429 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">2</span>, <span class="number">3</span>][..]));
430 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>][..]));
431 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">None</span>);</code></pre></div>
432 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_at" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1911">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_at" class="fn">split_at</a>(&amp;self, mid: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; (&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)</h4></section></summary><div class="docblock"><p>Divides one slice into two at an index.</p>
433 <p>The first will contain all indices from <code>[0, mid)</code> (excluding
434 the index <code>mid</code> itself) and the second will contain all
435 indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
436 <h5 id="panics-9"><a class="doc-anchor" href="#panics-9">§</a>Panics</h5>
437 <p>Panics if <code>mid &gt; len</code>. For a non-panicking alternative see
438 <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_at_checked" title="method slice::split_at_checked"><code>split_at_checked</code></a>.</p>
439 <h5 id="examples-29"><a class="doc-anchor" href="#examples-29">§</a>Examples</h5>
440 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>];
441
442 {
443 <span class="kw">let </span>(left, right) = v.split_at(<span class="number">0</span>);
444 <span class="macro">assert_eq!</span>(left, []);
445 <span class="macro">assert_eq!</span>(right, [<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>]);
446 }
447
448 {
449 <span class="kw">let </span>(left, right) = v.split_at(<span class="number">2</span>);
450 <span class="macro">assert_eq!</span>(left, [<span class="string">'a'</span>, <span class="string">'b'</span>]);
451 <span class="macro">assert_eq!</span>(right, [<span class="string">'c'</span>]);
452 }
453
454 {
455 <span class="kw">let </span>(left, right) = v.split_at(<span class="number">3</span>);
456 <span class="macro">assert_eq!</span>(left, [<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>]);
457 <span class="macro">assert_eq!</span>(right, []);
458 }</code></pre></div>
459 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_at_unchecked" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.79.0">1.79.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#1996">Source</a></span><h4 class="code-header">pub unsafe fn <a href="#method.split_at_unchecked" class="fn">split_at_unchecked</a>(&amp;self, mid: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; (&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)</h4></section></summary><div class="docblock"><p>Divides one slice into two at an index, without doing bounds checking.</p>
460 <p>The first will contain all indices from <code>[0, mid)</code> (excluding
461 the index <code>mid</code> itself) and the second will contain all
462 indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
463 <p>For a safe alternative see <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_at" title="method slice::split_at"><code>split_at</code></a>.</p>
464 <h5 id="safety-3"><a class="doc-anchor" href="#safety-3">§</a>Safety</h5>
465 <p>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>
466 even if the resulting reference is not used. The caller has to ensure that
467 <code>0 &lt;= mid &lt;= self.len()</code>.</p>
468 <h5 id="examples-30"><a class="doc-anchor" href="#examples-30">§</a>Examples</h5>
469 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>];
470
471 <span class="kw">unsafe </span>{
472 <span class="kw">let </span>(left, right) = v.split_at_unchecked(<span class="number">0</span>);
473 <span class="macro">assert_eq!</span>(left, []);
474 <span class="macro">assert_eq!</span>(right, [<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>]);
475 }
476
477 <span class="kw">unsafe </span>{
478 <span class="kw">let </span>(left, right) = v.split_at_unchecked(<span class="number">2</span>);
479 <span class="macro">assert_eq!</span>(left, [<span class="string">'a'</span>, <span class="string">'b'</span>]);
480 <span class="macro">assert_eq!</span>(right, [<span class="string">'c'</span>]);
481 }
482
483 <span class="kw">unsafe </span>{
484 <span class="kw">let </span>(left, right) = v.split_at_unchecked(<span class="number">3</span>);
485 <span class="macro">assert_eq!</span>(left, [<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>]);
486 <span class="macro">assert_eq!</span>(right, []);
487 }</code></pre></div>
488 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_at_checked" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2110">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_at_checked" class="fn">split_at_checked</a>(&amp;self, mid: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)&gt;</h4></section></summary><div class="docblock"><p>Divides one slice into two at an index, returning <code>None</code> if the slice is
489 too short.</p>
490 <p>If <code>mid ≤ len</code> returns a pair of slices where the first will contain all
491 indices from <code>[0, mid)</code> (excluding the index <code>mid</code> itself) and the
492 second will contain all indices from <code>[mid, len)</code> (excluding the index
493 <code>len</code> itself).</p>
494 <p>Otherwise, if <code>mid &gt; len</code>, returns <code>None</code>.</p>
495 <h5 id="examples-31"><a class="doc-anchor" href="#examples-31">§</a>Examples</h5>
496 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<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>];
497
498 {
499 <span class="kw">let </span>(left, right) = v.split_at_checked(<span class="number">0</span>).unwrap();
500 <span class="macro">assert_eq!</span>(left, []);
501 <span class="macro">assert_eq!</span>(right, [<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>]);
502 }
503
504 {
505 <span class="kw">let </span>(left, right) = v.split_at_checked(<span class="number">2</span>).unwrap();
506 <span class="macro">assert_eq!</span>(left, [<span class="number">1</span>, -<span class="number">2</span>]);
507 <span class="macro">assert_eq!</span>(right, [<span class="number">3</span>, -<span class="number">4</span>, <span class="number">5</span>, -<span class="number">6</span>]);
508 }
509
510 {
511 <span class="kw">let </span>(left, right) = v.split_at_checked(<span class="number">6</span>).unwrap();
512 <span class="macro">assert_eq!</span>(left, [<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>]);
513 <span class="macro">assert_eq!</span>(right, []);
514 }
515
516 <span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, v.split_at_checked(<span class="number">7</span>));</code></pre></div>
517 </div></details><details class="toggle method-toggle" open><summary><section id="method.split" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2201-2203">Source</a></span><h4 class="code-header">pub fn <a href="#method.split" class="fn">split</a>&lt;F&gt;(&amp;self, pred: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.Split.html" title="struct core::slice::iter::Split">Split</a>&lt;'_, T, F&gt; <a href="#" class="tooltip" data-notable-ty="Split&lt;&#39;_, T, F&gt;">ⓘ</a><div class="where">where
518 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over subslices separated by elements that match
519 <code>pred</code>. The matched element is not contained in the subslices.</p>
520 <h5 id="examples-32"><a class="doc-anchor" href="#examples-32">§</a>Examples</h5>
521 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>, <span class="number">20</span>];
522 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.split(|num| num % <span class="number">3 </span>== <span class="number">0</span>);
523
524 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>]);
525 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">20</span>]);
526 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
527 <p>If the first element is matched, an empty slice will be the first item
528 returned by the iterator. Similarly, if the last element in the slice
529 is matched, an empty slice will be the last item returned by the
530 iterator:</p>
531
532 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>];
533 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.split(|num| num % <span class="number">3 </span>== <span class="number">0</span>);
534
535 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>]);
536 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[]);
537 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
538 <p>If two matched elements are directly adjacent, an empty slice will be
539 present between them:</p>
540
541 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<span class="number">10</span>, <span class="number">6</span>, <span class="number">33</span>, <span class="number">20</span>];
542 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.split(|num| num % <span class="number">3 </span>== <span class="number">0</span>);
543
544 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">10</span>]);
545 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[]);
546 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">20</span>]);
547 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
548 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_inclusive" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2259-2261">Source</a></span><h4 class="code-header">pub fn <a href="#method.split_inclusive" class="fn">split_inclusive</a>&lt;F&gt;(&amp;self, pred: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.SplitInclusive.html" title="struct core::slice::iter::SplitInclusive">SplitInclusive</a>&lt;'_, T, F&gt; <a href="#" class="tooltip" data-notable-ty="SplitInclusive&lt;&#39;_, T, F&gt;">ⓘ</a><div class="where">where
549 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over subslices separated by elements that match
550 <code>pred</code>. The matched element is contained in the end of the previous
551 subslice as a terminator.</p>
552 <h5 id="examples-33"><a class="doc-anchor" href="#examples-33">§</a>Examples</h5>
553 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>, <span class="number">20</span>];
554 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.split_inclusive(|num| num % <span class="number">3 </span>== <span class="number">0</span>);
555
556 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>]);
557 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">20</span>]);
558 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
559 <p>If the last element of the slice is matched,
560 that element will be considered the terminator of the preceding slice.
561 That slice will be the last item returned by the iterator.</p>
562
563 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<span class="number">3</span>, <span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>];
564 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.split_inclusive(|num| num % <span class="number">3 </span>== <span class="number">0</span>);
565
566 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">3</span>]);
567 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">33</span>]);
568 <span class="macro">assert!</span>(iter.next().is_none());</code></pre></div>
569 </div></details><details class="toggle method-toggle" open><summary><section id="method.rsplit" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2319-2321">Source</a></span><h4 class="code-header">pub fn <a href="#method.rsplit" class="fn">rsplit</a>&lt;F&gt;(&amp;self, pred: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.RSplit.html" title="struct core::slice::iter::RSplit">RSplit</a>&lt;'_, T, F&gt; <a href="#" class="tooltip" data-notable-ty="RSplit&lt;&#39;_, T, F&gt;">ⓘ</a><div class="where">where
570 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over subslices separated by elements that match
571 <code>pred</code>, starting at the end of the slice and working backwards.
572 The matched element is not contained in the subslices.</p>
573 <h5 id="examples-34"><a class="doc-anchor" href="#examples-34">§</a>Examples</h5>
574 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>slice = [<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>];
575 <span class="kw">let </span><span class="kw-2">mut </span>iter = slice.rsplit(|num| <span class="kw-2">*</span>num == <span class="number">0</span>);
576
577 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">44</span>, <span class="number">55</span>]);
578 <span class="macro">assert_eq!</span>(iter.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>]);
579 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">None</span>);</code></pre></div>
580 <p>As with <code>split()</code>, if the first or last element is matched, an empty
581 slice will be the first (or last) item returned by the iterator.</p>
582
583 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="kw-2">&amp;</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>];
584 <span class="kw">let </span><span class="kw-2">mut </span>it = v.rsplit(|n| <span class="kw-2">*</span>n % <span class="number">2 </span>== <span class="number">0</span>);
585 <span class="macro">assert_eq!</span>(it.next().unwrap(), <span class="kw-2">&amp;</span>[]);
586 <span class="macro">assert_eq!</span>(it.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">3</span>, <span class="number">5</span>]);
587 <span class="macro">assert_eq!</span>(it.next().unwrap(), <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">1</span>]);
588 <span class="macro">assert_eq!</span>(it.next().unwrap(), <span class="kw-2">&amp;</span>[]);
589 <span class="macro">assert_eq!</span>(it.next(), <span class="prelude-val">None</span>);</code></pre></div>
590 </div></details><details class="toggle method-toggle" open><summary><section id="method.splitn" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2373-2375">Source</a></span><h4 class="code-header">pub fn <a href="#method.splitn" class="fn">splitn</a>&lt;F&gt;(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pred: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.SplitN.html" title="struct core::slice::iter::SplitN">SplitN</a>&lt;'_, T, F&gt; <a href="#" class="tooltip" data-notable-ty="SplitN&lt;&#39;_, T, F&gt;">ⓘ</a><div class="where">where
591 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over subslices separated by elements that match
592 <code>pred</code>, limited to returning at most <code>n</code> items. The matched element is
593 not contained in the subslices.</p>
594 <p>The last element returned, if any, will contain the remainder of the
595 slice.</p>
596 <h5 id="examples-35"><a class="doc-anchor" href="#examples-35">§</a>Examples</h5>
597 <p>Print the slice split once by numbers divisible by 3 (i.e., <code>[10, 40]</code>,
598 <code>[20, 60, 50]</code>):</p>
599
600 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<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>];
601
602 <span class="kw">for </span>group <span class="kw">in </span>v.splitn(<span class="number">2</span>, |num| <span class="kw-2">*</span>num % <span class="number">3 </span>== <span class="number">0</span>) {
603 <span class="macro">println!</span>(<span class="string">"{group:?}"</span>);
604 }</code></pre></div>
605 </div></details><details class="toggle method-toggle" open><summary><section id="method.rsplitn" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2428-2430">Source</a></span><h4 class="code-header">pub fn <a href="#method.rsplitn" class="fn">rsplitn</a>&lt;F&gt;(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pred: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.RSplitN.html" title="struct core::slice::iter::RSplitN">RSplitN</a>&lt;'_, T, F&gt; <a href="#" class="tooltip" data-notable-ty="RSplitN&lt;&#39;_, T, F&gt;">ⓘ</a><div class="where">where
606 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over subslices separated by elements that match
607 <code>pred</code> limited to returning at most <code>n</code> items. This starts at the end of
608 the slice and works backwards. The matched element is not contained in
609 the subslices.</p>
610 <p>The last element returned, if any, will contain the remainder of the
611 slice.</p>
612 <h5 id="examples-36"><a class="doc-anchor" href="#examples-36">§</a>Examples</h5>
613 <p>Print the slice split once, starting from the end, by numbers divisible
614 by 3 (i.e., <code>[50]</code>, <code>[10, 40, 30, 20]</code>):</p>
615
616 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<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>];
617
618 <span class="kw">for </span>group <span class="kw">in </span>v.rsplitn(<span class="number">2</span>, |num| <span class="kw-2">*</span>num % <span class="number">3 </span>== <span class="number">0</span>) {
619 <span class="macro">println!</span>(<span class="string">"{group:?}"</span>);
620 }</code></pre></div>
621 </div></details><details class="toggle method-toggle" open><summary><section id="method.split_once" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2482-2484">Source</a><h4 class="code-header">pub fn <a href="#method.split_once" class="fn">split_once</a>&lt;F&gt;(&amp;self, pred: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)&gt;<div class="where">where
622 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_split_once</code>)</span></div></span></summary><div class="docblock"><p>Splits the slice on the first element that matches the specified
623 predicate.</p>
624 <p>If any matching elements are present in the slice, returns the prefix
625 before the match and suffix after. The matching element itself is not
626 included. If no elements match, returns <code>None</code>.</p>
627 <h5 id="examples-37"><a class="doc-anchor" href="#examples-37">§</a>Examples</h5>
628 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(slice_split_once)]
629 </span><span class="kw">let </span>s = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">4</span>];
630 <span class="macro">assert_eq!</span>(s.split_once(|<span class="kw-2">&amp;</span>x| x == <span class="number">2</span>), <span class="prelude-val">Some</span>((
631 <span class="kw-2">&amp;</span>[<span class="number">1</span>][..],
632 <span class="kw-2">&amp;</span>[<span class="number">3</span>, <span class="number">2</span>, <span class="number">4</span>][..]
633 )));
634 <span class="macro">assert_eq!</span>(s.split_once(|<span class="kw-2">&amp;</span>x| x == <span class="number">0</span>), <span class="prelude-val">None</span>);</code></pre></div>
635 </div></details><details class="toggle method-toggle" open><summary><section id="method.rsplit_once" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2510-2512">Source</a><h4 class="code-header">pub fn <a href="#method.rsplit_once" class="fn">rsplit_once</a>&lt;F&gt;(&amp;self, pred: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)&gt;<div class="where">where
636 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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_split_once</code>)</span></div></span></summary><div class="docblock"><p>Splits the slice on the last element that matches the specified
637 predicate.</p>
638 <p>If any matching elements are present in the slice, returns the prefix
639 before the match and suffix after. The matching element itself is not
640 included. If no elements match, returns <code>None</code>.</p>
641 <h5 id="examples-38"><a class="doc-anchor" href="#examples-38">§</a>Examples</h5>
642 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(slice_split_once)]
643 </span><span class="kw">let </span>s = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">4</span>];
644 <span class="macro">assert_eq!</span>(s.rsplit_once(|<span class="kw-2">&amp;</span>x| x == <span class="number">2</span>), <span class="prelude-val">Some</span>((
645 <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>][..],
646 <span class="kw-2">&amp;</span>[<span class="number">4</span>][..]
647 )));
648 <span class="macro">assert_eq!</span>(s.rsplit_once(|<span class="kw-2">&amp;</span>x| x == <span class="number">0</span>), <span class="prelude-val">None</span>);</code></pre></div>
649 </div></details><details class="toggle method-toggle" open><summary><section id="method.contains" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2546-2548">Source</a></span><h4 class="code-header">pub fn <a href="#method.contains" class="fn">contains</a>(&amp;self, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
650 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the slice contains an element with the given value.</p>
651 <p>This operation is <em>O</em>(<em>n</em>).</p>
652 <p>Note that if you have a sorted slice, <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search" title="method slice::binary_search"><code>binary_search</code></a> may be faster.</p>
653 <h5 id="examples-39"><a class="doc-anchor" href="#examples-39">§</a>Examples</h5>
654 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
655 <span class="macro">assert!</span>(v.contains(<span class="kw-2">&amp;</span><span class="number">30</span>));
656 <span class="macro">assert!</span>(!v.contains(<span class="kw-2">&amp;</span><span class="number">50</span>));</code></pre></div>
657 <p>If you do not have a <code>&amp;T</code>, but some other value that you can compare
658 with one (for example, <code>String</code> implements <code>PartialEq&lt;str&gt;</code>), you can
659 use <code>iter().any</code>:</p>
660
661 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [String::from(<span class="string">"hello"</span>), String::from(<span class="string">"world"</span>)]; <span class="comment">// slice of `String`
662 </span><span class="macro">assert!</span>(v.iter().any(|e| e == <span class="string">"hello"</span>)); <span class="comment">// search with `&amp;str`
663 </span><span class="macro">assert!</span>(!v.iter().any(|e| e == <span class="string">"hi"</span>));</code></pre></div>
664 </div></details><details class="toggle method-toggle" open><summary><section id="method.starts_with" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2576-2578">Source</a></span><h4 class="code-header">pub fn <a href="#method.starts_with" class="fn">starts_with</a>(&amp;self, needle: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
665 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if <code>needle</code> is a prefix of the slice or equal to the slice.</p>
666 <h5 id="examples-40"><a class="doc-anchor" href="#examples-40">§</a>Examples</h5>
667 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
668 <span class="macro">assert!</span>(v.starts_with(<span class="kw-2">&amp;</span>[<span class="number">10</span>]));
669 <span class="macro">assert!</span>(v.starts_with(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>]));
670 <span class="macro">assert!</span>(v.starts_with(<span class="kw-2">&amp;</span>v));
671 <span class="macro">assert!</span>(!v.starts_with(<span class="kw-2">&amp;</span>[<span class="number">50</span>]));
672 <span class="macro">assert!</span>(!v.starts_with(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">50</span>]));</code></pre></div>
673 <p>Always returns <code>true</code> if <code>needle</code> is an empty slice:</p>
674
675 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
676 <span class="macro">assert!</span>(v.starts_with(<span class="kw-2">&amp;</span>[]));
677 <span class="kw">let </span>v: <span class="kw-2">&amp;</span>[u8] = <span class="kw-2">&amp;</span>[];
678 <span class="macro">assert!</span>(v.starts_with(<span class="kw-2">&amp;</span>[]));</code></pre></div>
679 </div></details><details class="toggle method-toggle" open><summary><section id="method.ends_with" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2607-2609">Source</a></span><h4 class="code-header">pub fn <a href="#method.ends_with" class="fn">ends_with</a>(&amp;self, needle: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
680 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if <code>needle</code> is a suffix of the slice or equal to the slice.</p>
681 <h5 id="examples-41"><a class="doc-anchor" href="#examples-41">§</a>Examples</h5>
682 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
683 <span class="macro">assert!</span>(v.ends_with(<span class="kw-2">&amp;</span>[<span class="number">30</span>]));
684 <span class="macro">assert!</span>(v.ends_with(<span class="kw-2">&amp;</span>[<span class="number">40</span>, <span class="number">30</span>]));
685 <span class="macro">assert!</span>(v.ends_with(<span class="kw-2">&amp;</span>v));
686 <span class="macro">assert!</span>(!v.ends_with(<span class="kw-2">&amp;</span>[<span class="number">50</span>]));
687 <span class="macro">assert!</span>(!v.ends_with(<span class="kw-2">&amp;</span>[<span class="number">50</span>, <span class="number">30</span>]));</code></pre></div>
688 <p>Always returns <code>true</code> if <code>needle</code> is an empty slice:</p>
689
690 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
691 <span class="macro">assert!</span>(v.ends_with(<span class="kw-2">&amp;</span>[]));
692 <span class="kw">let </span>v: <span class="kw-2">&amp;</span>[u8] = <span class="kw-2">&amp;</span>[];
693 <span class="macro">assert!</span>(v.ends_with(<span class="kw-2">&amp;</span>[]));</code></pre></div>
694 </div></details><details class="toggle method-toggle" open><summary><section id="method.strip_prefix" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2639-2641">Source</a></span><h4 class="code-header">pub fn <a href="#method.strip_prefix" class="fn">strip_prefix</a>&lt;P&gt;(&amp;self, prefix: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;P</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>&gt;<div class="where">where
695 P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/trait.SlicePattern.html" title="trait core::slice::SlicePattern">SlicePattern</a>&lt;Item = T&gt; + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
696 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><div class="docblock"><p>Returns a subslice with the prefix removed.</p>
697 <p>If the slice starts with <code>prefix</code>, returns the subslice after the prefix, wrapped in <code>Some</code>.
698 If <code>prefix</code> is empty, simply returns the original slice. If <code>prefix</code> is equal to the
699 original slice, returns an empty slice.</p>
700 <p>If the slice does not start with <code>prefix</code>, returns <code>None</code>.</p>
701 <h5 id="examples-42"><a class="doc-anchor" href="#examples-42">§</a>Examples</h5>
702 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
703 <span class="macro">assert_eq!</span>(v.strip_prefix(<span class="kw-2">&amp;</span>[<span class="number">10</span>]), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">40</span>, <span class="number">30</span>][..]));
704 <span class="macro">assert_eq!</span>(v.strip_prefix(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>]), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">30</span>][..]));
705 <span class="macro">assert_eq!</span>(v.strip_prefix(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>]), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[][..]));
706 <span class="macro">assert_eq!</span>(v.strip_prefix(<span class="kw-2">&amp;</span>[<span class="number">50</span>]), <span class="prelude-val">None</span>);
707 <span class="macro">assert_eq!</span>(v.strip_prefix(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">50</span>]), <span class="prelude-val">None</span>);
708
709 <span class="kw">let </span>prefix : <span class="kw-2">&amp;</span>str = <span class="string">"he"</span>;
710 <span class="macro">assert_eq!</span>(<span class="string">b"hello"</span>.strip_prefix(prefix.as_bytes()),
711 <span class="prelude-val">Some</span>(<span class="string">b"llo"</span>.as_ref()));</code></pre></div>
712 </div></details><details class="toggle method-toggle" open><summary><section id="method.strip_suffix" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2675-2677">Source</a></span><h4 class="code-header">pub fn <a href="#method.strip_suffix" class="fn">strip_suffix</a>&lt;P&gt;(&amp;self, suffix: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;P</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>&gt;<div class="where">where
713 P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/trait.SlicePattern.html" title="trait core::slice::SlicePattern">SlicePattern</a>&lt;Item = T&gt; + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
714 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><div class="docblock"><p>Returns a subslice with the suffix removed.</p>
715 <p>If the slice ends with <code>suffix</code>, returns the subslice before the suffix, wrapped in <code>Some</code>.
716 If <code>suffix</code> is empty, simply returns the original slice. If <code>suffix</code> is equal to the
717 original slice, returns an empty slice.</p>
718 <p>If the slice does not end with <code>suffix</code>, returns <code>None</code>.</p>
719 <h5 id="examples-43"><a class="doc-anchor" href="#examples-43">§</a>Examples</h5>
720 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
721 <span class="macro">assert_eq!</span>(v.strip_suffix(<span class="kw-2">&amp;</span>[<span class="number">30</span>]), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>][..]));
722 <span class="macro">assert_eq!</span>(v.strip_suffix(<span class="kw-2">&amp;</span>[<span class="number">40</span>, <span class="number">30</span>]), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[<span class="number">10</span>][..]));
723 <span class="macro">assert_eq!</span>(v.strip_suffix(<span class="kw-2">&amp;</span>[<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>]), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>[][..]));
724 <span class="macro">assert_eq!</span>(v.strip_suffix(<span class="kw-2">&amp;</span>[<span class="number">50</span>]), <span class="prelude-val">None</span>);
725 <span class="macro">assert_eq!</span>(v.strip_suffix(<span class="kw-2">&amp;</span>[<span class="number">50</span>, <span class="number">30</span>]), <span class="prelude-val">None</span>);</code></pre></div>
726 </div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2761-2763">Source</a></span><h4 class="code-header">pub fn <a href="#method.binary_search" class="fn">binary_search</a>(&amp;self, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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>&gt;<div class="where">where
727 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><div class="docblock"><p>Binary searches this slice for a given element.
728 If the slice is not sorted, the returned result is unspecified and
729 meaningless.</p>
730 <p>If the value is found then <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Result::Ok</code></a> is returned, containing the
731 index of the matching element. If there are multiple matches, then any
732 one of the matches could be returned. The index is chosen
733 deterministically, but is subject to change in future versions of Rust.
734 If the value is not found then <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Result::Err</code></a> is returned, containing
735 the index where a matching element could be inserted while maintaining
736 sorted order.</p>
737 <p>See also <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by" title="method slice::binary_search_by"><code>binary_search_by</code></a>, <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by_key" title="method slice::binary_search_by_key"><code>binary_search_by_key</code></a>, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.partition_point" title="method slice::partition_point"><code>partition_point</code></a>.</p>
738 <h5 id="examples-44"><a class="doc-anchor" href="#examples-44">§</a>Examples</h5>
739 <p>Looks up a series of four elements. The first is found, with a
740 uniquely determined position; the second and third are not
741 found; the fourth could match any position in <code>[1, 4]</code>.</p>
742
743 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = [<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>];
744
745 <span class="macro">assert_eq!</span>(s.binary_search(<span class="kw-2">&amp;</span><span class="number">13</span>), <span class="prelude-val">Ok</span>(<span class="number">9</span>));
746 <span class="macro">assert_eq!</span>(s.binary_search(<span class="kw-2">&amp;</span><span class="number">4</span>), <span class="prelude-val">Err</span>(<span class="number">7</span>));
747 <span class="macro">assert_eq!</span>(s.binary_search(<span class="kw-2">&amp;</span><span class="number">100</span>), <span class="prelude-val">Err</span>(<span class="number">13</span>));
748 <span class="kw">let </span>r = s.binary_search(<span class="kw-2">&amp;</span><span class="number">1</span>);
749 <span class="macro">assert!</span>(<span class="kw">match </span>r { <span class="prelude-val">Ok</span>(<span class="number">1</span>..=<span class="number">4</span>) =&gt; <span class="bool-val">true</span>, <span class="kw">_ </span>=&gt; <span class="bool-val">false</span>, });</code></pre></div>
750 <p>If you want to find that whole <em>range</em> of matching items, rather than
751 an arbitrary matching one, that can be done using <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.partition_point" title="method slice::partition_point"><code>partition_point</code></a>:</p>
752
753 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = [<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>];
754
755 <span class="kw">let </span>low = s.partition_point(|x| x &lt; <span class="kw-2">&amp;</span><span class="number">1</span>);
756 <span class="macro">assert_eq!</span>(low, <span class="number">1</span>);
757 <span class="kw">let </span>high = s.partition_point(|x| x &lt;= <span class="kw-2">&amp;</span><span class="number">1</span>);
758 <span class="macro">assert_eq!</span>(high, <span class="number">5</span>);
759 <span class="kw">let </span>r = s.binary_search(<span class="kw-2">&amp;</span><span class="number">1</span>);
760 <span class="macro">assert!</span>((low..high).contains(<span class="kw-2">&amp;</span>r.unwrap()));
761
762 <span class="macro">assert!</span>(s[..low].iter().all(|<span class="kw-2">&amp;</span>x| x &lt; <span class="number">1</span>));
763 <span class="macro">assert!</span>(s[low..high].iter().all(|<span class="kw-2">&amp;</span>x| x == <span class="number">1</span>));
764 <span class="macro">assert!</span>(s[high..].iter().all(|<span class="kw-2">&amp;</span>x| x &gt; <span class="number">1</span>));
765
766 <span class="comment">// For something not found, the "range" of equal items is empty
767 </span><span class="macro">assert_eq!</span>(s.partition_point(|x| x &lt; <span class="kw-2">&amp;</span><span class="number">11</span>), <span class="number">9</span>);
768 <span class="macro">assert_eq!</span>(s.partition_point(|x| x &lt;= <span class="kw-2">&amp;</span><span class="number">11</span>), <span class="number">9</span>);
769 <span class="macro">assert_eq!</span>(s.binary_search(<span class="kw-2">&amp;</span><span class="number">11</span>), <span class="prelude-val">Err</span>(<span class="number">9</span>));</code></pre></div>
770 <p>If you want to insert an item to a sorted vector, while maintaining
771 sort order, consider using <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.partition_point" title="method slice::partition_point"><code>partition_point</code></a>:</p>
772
773 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>s = <span class="macro">vec!</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>];
774 <span class="kw">let </span>num = <span class="number">42</span>;
775 <span class="kw">let </span>idx = s.partition_point(|<span class="kw-2">&amp;</span>x| x &lt;= num);
776 <span class="comment">// If `num` is unique, `s.partition_point(|&amp;x| x &lt; num)` (with `&lt;`) is equivalent to
777 // `s.binary_search(&amp;num).unwrap_or_else(|x| x)`, but using `&lt;=` will allow `insert`
778 // to shift less elements.
779 </span>s.insert(idx, num);
780 <span class="macro">assert_eq!</span>(s, [<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>]);</code></pre></div>
781 </div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_by" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2812-2814">Source</a></span><h4 class="code-header">pub fn <a href="#method.binary_search_by" class="fn">binary_search_by</a>&lt;'a, F&gt;(&amp;'a self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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>&gt;<div class="where">where
782 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">&amp;'a T</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><div class="docblock"><p>Binary searches this slice with a comparator function.</p>
783 <p>The comparator function should return an order code that indicates
784 whether its argument is <code>Less</code>, <code>Equal</code> or <code>Greater</code> the desired
785 target.
786 If the slice is not sorted or if the comparator function does not
787 implement an order consistent with the sort order of the underlying
788 slice, the returned result is unspecified and meaningless.</p>
789 <p>If the value is found then <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Result::Ok</code></a> is returned, containing the
790 index of the matching element. If there are multiple matches, then any
791 one of the matches could be returned. The index is chosen
792 deterministically, but is subject to change in future versions of Rust.
793 If the value is not found then <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Result::Err</code></a> is returned, containing
794 the index where a matching element could be inserted while maintaining
795 sorted order.</p>
796 <p>See also <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search" title="method slice::binary_search"><code>binary_search</code></a>, <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by_key" title="method slice::binary_search_by_key"><code>binary_search_by_key</code></a>, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.partition_point" title="method slice::partition_point"><code>partition_point</code></a>.</p>
797 <h5 id="examples-45"><a class="doc-anchor" href="#examples-45">§</a>Examples</h5>
798 <p>Looks up a series of four elements. The first is found, with a
799 uniquely determined position; the second and third are not
800 found; the fourth could match any position in <code>[1, 4]</code>.</p>
801
802 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = [<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>];
803
804 <span class="kw">let </span>seek = <span class="number">13</span>;
805 <span class="macro">assert_eq!</span>(s.binary_search_by(|probe| probe.cmp(<span class="kw-2">&amp;</span>seek)), <span class="prelude-val">Ok</span>(<span class="number">9</span>));
806 <span class="kw">let </span>seek = <span class="number">4</span>;
807 <span class="macro">assert_eq!</span>(s.binary_search_by(|probe| probe.cmp(<span class="kw-2">&amp;</span>seek)), <span class="prelude-val">Err</span>(<span class="number">7</span>));
808 <span class="kw">let </span>seek = <span class="number">100</span>;
809 <span class="macro">assert_eq!</span>(s.binary_search_by(|probe| probe.cmp(<span class="kw-2">&amp;</span>seek)), <span class="prelude-val">Err</span>(<span class="number">13</span>));
810 <span class="kw">let </span>seek = <span class="number">1</span>;
811 <span class="kw">let </span>r = s.binary_search_by(|probe| probe.cmp(<span class="kw-2">&amp;</span>seek));
812 <span class="macro">assert!</span>(<span class="kw">match </span>r { <span class="prelude-val">Ok</span>(<span class="number">1</span>..=<span class="number">4</span>) =&gt; <span class="bool-val">true</span>, <span class="kw">_ </span>=&gt; <span class="bool-val">false</span>, });</code></pre></div>
813 </div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_by_key" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.10.0">1.10.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#2913-2916">Source</a></span><h4 class="code-header">pub fn <a href="#method.binary_search_by_key" class="fn">binary_search_by_key</a>&lt;'a, B, F&gt;(
814 &amp;'a self,
815 b: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;B</a>,
816 f: F,
817 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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>&gt;<div class="where">where
818 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">&amp;'a T</a>) -&gt; B,
819 B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><div class="docblock"><p>Binary searches this slice with a key extraction function.</p>
820 <p>Assumes that the slice is sorted by the key, for instance with
821 <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.sort_by_key" title="method slice::sort_by_key"><code>sort_by_key</code></a> using the same key extraction function.
822 If the slice is not sorted by the key, the returned result is
823 unspecified and meaningless.</p>
824 <p>If the value is found then <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Result::Ok</code></a> is returned, containing the
825 index of the matching element. If there are multiple matches, then any
826 one of the matches could be returned. The index is chosen
827 deterministically, but is subject to change in future versions of Rust.
828 If the value is not found then <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Result::Err</code></a> is returned, containing
829 the index where a matching element could be inserted while maintaining
830 sorted order.</p>
831 <p>See also <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search" title="method slice::binary_search"><code>binary_search</code></a>, <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by" title="method slice::binary_search_by"><code>binary_search_by</code></a>, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.partition_point" title="method slice::partition_point"><code>partition_point</code></a>.</p>
832 <h5 id="examples-46"><a class="doc-anchor" href="#examples-46">§</a>Examples</h5>
833 <p>Looks up a series of four elements in a slice of pairs sorted by
834 their second elements. The first is found, with a uniquely
835 determined position; the second and third are not found; the
836 fourth could match any position in <code>[1, 4]</code>.</p>
837
838 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = [(<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>),
839 (<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>),
840 (<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>)];
841
842 <span class="macro">assert_eq!</span>(s.binary_search_by_key(<span class="kw-2">&amp;</span><span class="number">13</span>, |<span class="kw-2">&amp;</span>(a, b)| b), <span class="prelude-val">Ok</span>(<span class="number">9</span>));
843 <span class="macro">assert_eq!</span>(s.binary_search_by_key(<span class="kw-2">&amp;</span><span class="number">4</span>, |<span class="kw-2">&amp;</span>(a, b)| b), <span class="prelude-val">Err</span>(<span class="number">7</span>));
844 <span class="macro">assert_eq!</span>(s.binary_search_by_key(<span class="kw-2">&amp;</span><span class="number">100</span>, |<span class="kw-2">&amp;</span>(a, b)| b), <span class="prelude-val">Err</span>(<span class="number">13</span>));
845 <span class="kw">let </span>r = s.binary_search_by_key(<span class="kw-2">&amp;</span><span class="number">1</span>, |<span class="kw-2">&amp;</span>(a, b)| b);
846 <span class="macro">assert!</span>(<span class="kw">match </span>r { <span class="prelude-val">Ok</span>(<span class="number">1</span>..=<span class="number">4</span>) =&gt; <span class="bool-val">true</span>, <span class="kw">_ </span>=&gt; <span class="bool-val">false</span>, });</code></pre></div>
847 </div></details><details class="toggle method-toggle" open><summary><section id="method.align_to" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#3907">Source</a></span><h4 class="code-header">pub unsafe fn <a href="#method.align_to" class="fn">align_to</a>&lt;U&gt;(&amp;self) -&gt; (&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[U]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)</h4></section></summary><div class="docblock"><p>Transmutes the slice to a slice of another type, ensuring alignment of the types is
848 maintained.</p>
849 <p>This method splits the slice into three distinct slices: prefix, correctly aligned middle
850 slice of a new type, and the suffix slice. The middle part will be as big as possible under
851 the given alignment constraint and element size.</p>
852 <p>This method has no purpose when either input element <code>T</code> or output element <code>U</code> are
853 zero-sized and will return the original slice without splitting anything.</p>
854 <h5 id="safety-4"><a class="doc-anchor" href="#safety-4">§</a>Safety</h5>
855 <p>This method is essentially a <code>transmute</code> with respect to the elements in the returned
856 middle slice, so all the usual caveats pertaining to <code>transmute::&lt;T, U&gt;</code> also apply here.</p>
857 <h5 id="examples-47"><a class="doc-anchor" href="#examples-47">§</a>Examples</h5>
858 <p>Basic usage:</p>
859
860 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">unsafe </span>{
861 <span class="kw">let </span>bytes: [u8; <span class="number">7</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>];
862 <span class="kw">let </span>(prefix, shorts, suffix) = bytes.align_to::&lt;u16&gt;();
863 <span class="comment">// less_efficient_algorithm_for_bytes(prefix);
864 // more_efficient_algorithm_for_aligned_shorts(shorts);
865 // less_efficient_algorithm_for_bytes(suffix);
866 </span>}</code></pre></div>
867 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_simd" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4063-4067">Source</a><h4 class="code-header">pub fn <a href="#method.as_simd" class="fn">as_simd</a>&lt;const LANES: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;(&amp;self) -&gt; (&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>, &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/core/core_simd/vector/struct.Simd.html" title="struct core::core_simd::vector::Simd">Simd</a>&lt;T, LANES&gt;], &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>)<div class="where">where
868 <a class="struct" href="https://doc.rust-lang.org/nightly/core/core_simd/vector/struct.Simd.html" title="struct core::core_simd::vector::Simd">Simd</a>&lt;T, LANES&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; LANES]</a>&gt;,
869 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/core_simd/vector/trait.SimdElement.html" title="trait core::core_simd::vector::SimdElement">SimdElement</a>,
870 <a class="struct" href="https://doc.rust-lang.org/nightly/core/core_simd/lane_count/struct.LaneCount.html" title="struct core::core_simd::lane_count::LaneCount">LaneCount</a>&lt;LANES&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/core_simd/lane_count/trait.SupportedLaneCount.html" title="trait core::core_simd::lane_count::SupportedLaneCount">SupportedLaneCount</a>,</div></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>portable_simd</code>)</span></div></span></summary><div class="docblock"><p>Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.</p>
871 <p>This is a safe wrapper around <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.align_to" title="method slice::align_to"><code>slice::align_to</code></a>, so inherits the same
872 guarantees as that method.</p>
873 <h5 id="panics-10"><a class="doc-anchor" href="#panics-10">§</a>Panics</h5>
874 <p>This will panic if the size of the SIMD type is different from
875 <code>LANES</code> times that of the scalar.</p>
876 <p>At the time of writing, the trait restrictions on <code>Simd&lt;T, LANES&gt;</code> keeps
877 that from ever happening, as only power-of-two numbers of lanes are
878 supported. It’s possible that, in the future, those restrictions might
879 be lifted in a way that would make it possible to see panics from this
880 method for something like <code>LANES == 3</code>.</p>
881 <h5 id="examples-48"><a class="doc-anchor" href="#examples-48">§</a>Examples</h5>
882 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(portable_simd)]
883 </span><span class="kw">use </span>core::simd::prelude::<span class="kw-2">*</span>;
884
885 <span class="kw">let </span>short = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
886 <span class="kw">let </span>(prefix, middle, suffix) = short.as_simd::&lt;<span class="number">4</span>&gt;();
887 <span class="macro">assert_eq!</span>(middle, []); <span class="comment">// Not enough elements for anything in the middle
888
889 // They might be split in any possible way between prefix and suffix
890 </span><span class="kw">let </span>it = prefix.iter().chain(suffix).copied();
891 <span class="macro">assert_eq!</span>(it.collect::&lt;Vec&lt;<span class="kw">_</span>&gt;&gt;(), <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>]);
892
893 <span class="kw">fn </span>basic_simd_sum(x: <span class="kw-2">&amp;</span>[f32]) -&gt; f32 {
894 <span class="kw">use </span>std::ops::Add;
895 <span class="kw">let </span>(prefix, middle, suffix) = x.as_simd();
896 <span class="kw">let </span>sums = f32x4::from_array([
897 prefix.iter().copied().sum(),
898 <span class="number">0.0</span>,
899 <span class="number">0.0</span>,
900 suffix.iter().copied().sum(),
901 ]);
902 <span class="kw">let </span>sums = middle.iter().copied().fold(sums, f32x4::add);
903 sums.reduce_sum()
904 }
905
906 <span class="kw">let </span>numbers: Vec&lt;f32&gt; = (<span class="number">1</span>..<span class="number">101</span>).map(|x| x <span class="kw">as _</span>).collect();
907 <span class="macro">assert_eq!</span>(basic_simd_sum(<span class="kw-2">&amp;</span>numbers[<span class="number">1</span>..<span class="number">99</span>]), <span class="number">4949.0</span>);</code></pre></div>
908 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_sorted" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.82.0">1.82.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4138-4140">Source</a></span><h4 class="code-header">pub fn <a href="#method.is_sorted" class="fn">is_sorted</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
909 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h4></section></summary><div class="docblock"><p>Checks if the elements of this slice are sorted.</p>
910 <p>That is, for each element <code>a</code> and its following element <code>b</code>, <code>a &lt;= b</code> must hold. If the
911 slice yields exactly zero or one element, <code>true</code> is returned.</p>
912 <p>Note that if <code>Self::Item</code> is only <code>PartialOrd</code>, but not <code>Ord</code>, the above definition
913 implies that this function returns <code>false</code> if any two consecutive items are not
914 comparable.</p>
915 <h5 id="examples-49"><a class="doc-anchor" href="#examples-49">§</a>Examples</h5>
916 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>empty: [i32; <span class="number">0</span>] = [];
917
918 <span class="macro">assert!</span>([<span class="number">1</span>, <span class="number">2</span>, <span class="number">2</span>, <span class="number">9</span>].is_sorted());
919 <span class="macro">assert!</span>(![<span class="number">1</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">4</span>].is_sorted());
920 <span class="macro">assert!</span>([<span class="number">0</span>].is_sorted());
921 <span class="macro">assert!</span>(empty.is_sorted());
922 <span class="macro">assert!</span>(![<span class="number">0.0</span>, <span class="number">1.0</span>, f32::NAN].is_sorted());</code></pre></div>
923 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_sorted_by" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.82.0">1.82.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4181-4183">Source</a></span><h4 class="code-header">pub fn <a href="#method.is_sorted_by" class="fn">is_sorted_by</a>&lt;'a, F&gt;(&amp;'a self, compare: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
924 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">&amp;'a T</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Checks if the elements of this slice are sorted using the given comparator function.</p>
925 <p>Instead of using <code>PartialOrd::partial_cmp</code>, this function uses the given <code>compare</code>
926 function to determine whether two elements are to be considered in sorted order.</p>
927 <h5 id="examples-50"><a class="doc-anchor" href="#examples-50">§</a>Examples</h5>
928 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert!</span>([<span class="number">1</span>, <span class="number">2</span>, <span class="number">2</span>, <span class="number">9</span>].is_sorted_by(|a, b| a &lt;= b));
929 <span class="macro">assert!</span>(![<span class="number">1</span>, <span class="number">2</span>, <span class="number">2</span>, <span class="number">9</span>].is_sorted_by(|a, b| a &lt; b));
930
931 <span class="macro">assert!</span>([<span class="number">0</span>].is_sorted_by(|a, b| <span class="bool-val">true</span>));
932 <span class="macro">assert!</span>([<span class="number">0</span>].is_sorted_by(|a, b| <span class="bool-val">false</span>));
933
934 <span class="kw">let </span>empty: [i32; <span class="number">0</span>] = [];
935 <span class="macro">assert!</span>(empty.is_sorted_by(|a, b| <span class="bool-val">false</span>));
936 <span class="macro">assert!</span>(empty.is_sorted_by(|a, b| <span class="bool-val">true</span>));</code></pre></div>
937 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_sorted_by_key" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.82.0">1.82.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4205-4208">Source</a></span><h4 class="code-header">pub fn <a href="#method.is_sorted_by_key" class="fn">is_sorted_by_key</a>&lt;'a, F, K&gt;(&amp;'a self, f: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
938 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">&amp;'a T</a>) -&gt; K,
939 K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h4></section></summary><div class="docblock"><p>Checks if the elements of this slice are sorted using the given key extraction function.</p>
940 <p>Instead of comparing the slice’s elements directly, this function compares the keys of the
941 elements, as determined by <code>f</code>. Apart from that, it’s equivalent to <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted" title="method slice::is_sorted"><code>is_sorted</code></a>; see its
942 documentation for more information.</p>
943 <h5 id="examples-51"><a class="doc-anchor" href="#examples-51">§</a>Examples</h5>
944 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert!</span>([<span class="string">"c"</span>, <span class="string">"bb"</span>, <span class="string">"aaa"</span>].is_sorted_by_key(|s| s.len()));
945 <span class="macro">assert!</span>(![-<span class="number">2i32</span>, -<span class="number">1</span>, <span class="number">0</span>, <span class="number">3</span>].is_sorted_by_key(|n| n.abs()));</code></pre></div>
946 </div></details><details class="toggle method-toggle" open><summary><section id="method.partition_point" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.52.0">1.52.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4264-4266">Source</a></span><h4 class="code-header">pub fn <a href="#method.partition_point" class="fn">partition_point</a>&lt;P&gt;(&amp;self, pred: P) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><div class="where">where
947 P: <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">&amp;T</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Returns the index of the partition point according to the given predicate
948 (the index of the first element of the second partition).</p>
949 <p>The slice is assumed to be partitioned according to the given predicate.
950 This means that all elements for which the predicate returns true are at the start of the slice
951 and all elements for which the predicate returns false are at the end.
952 For example, <code>[7, 15, 3, 5, 4, 12, 6]</code> is partitioned under the predicate <code>x % 2 != 0</code>
953 (all odd numbers are at the start, all even at the end).</p>
954 <p>If this slice is not partitioned, the returned result is unspecified and meaningless,
955 as this method performs a kind of binary search.</p>
956 <p>See also <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search" title="method slice::binary_search"><code>binary_search</code></a>, <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by" title="method slice::binary_search_by"><code>binary_search_by</code></a>, and <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by_key" title="method slice::binary_search_by_key"><code>binary_search_by_key</code></a>.</p>
957 <h5 id="examples-52"><a class="doc-anchor" href="#examples-52">§</a>Examples</h5>
958 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>];
959 <span class="kw">let </span>i = v.partition_point(|<span class="kw-2">&amp;</span>x| x &lt; <span class="number">5</span>);
960
961 <span class="macro">assert_eq!</span>(i, <span class="number">4</span>);
962 <span class="macro">assert!</span>(v[..i].iter().all(|<span class="kw-2">&amp;</span>x| x &lt; <span class="number">5</span>));
963 <span class="macro">assert!</span>(v[i..].iter().all(|<span class="kw-2">&amp;</span>x| !(x &lt; <span class="number">5</span>)));</code></pre></div>
964 <p>If all elements of the slice match the predicate, including if the slice
965 is empty, then the length of the slice will be returned:</p>
966
967 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>a = [<span class="number">2</span>, <span class="number">4</span>, <span class="number">8</span>];
968 <span class="macro">assert_eq!</span>(a.partition_point(|x| x &lt; <span class="kw-2">&amp;</span><span class="number">100</span>), a.len());
969 <span class="kw">let </span>a: [i32; <span class="number">0</span>] = [];
970 <span class="macro">assert_eq!</span>(a.partition_point(|x| x &lt; <span class="kw-2">&amp;</span><span class="number">100</span>), <span class="number">0</span>);</code></pre></div>
971 <p>If you want to insert an item to a sorted vector, while maintaining
972 sort order:</p>
973
974 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>s = <span class="macro">vec!</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>];
975 <span class="kw">let </span>num = <span class="number">42</span>;
976 <span class="kw">let </span>idx = s.partition_point(|<span class="kw-2">&amp;</span>x| x &lt;= num);
977 s.insert(idx, num);
978 <span class="macro">assert_eq!</span>(s, [<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>]);</code></pre></div>
979 </div></details><details class="toggle method-toggle" open><summary><section id="method.elem_offset" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4684">Source</a><h4 class="code-header">pub fn <a href="#method.elem_offset" class="fn">elem_offset</a>(&amp;self, element: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>substr_range</code>)</span></div></span></summary><div class="docblock"><p>Returns the index that an element reference points to.</p>
980 <p>Returns <code>None</code> if <code>element</code> does not point within the slice or if it points between elements.</p>
981 <p>This method is useful for extending slice iterators like <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split" title="method slice::split"><code>slice::split</code></a>.</p>
982 <p>Note that this uses pointer arithmetic and <strong>does not compare elements</strong>.
983 To find the index of an element via comparison, use
984 <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position" title="method core::iter::traits::iterator::Iterator::position"><code>.iter().position()</code></a> instead.</p>
985 <h5 id="panics-11"><a class="doc-anchor" href="#panics-11">§</a>Panics</h5>
986 <p>Panics if <code>T</code> is zero-sized.</p>
987 <h5 id="examples-53"><a class="doc-anchor" href="#examples-53">§</a>Examples</h5>
988 <p>Basic usage:</p>
989
990 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(substr_range)]
991
992 </span><span class="kw">let </span>nums: <span class="kw-2">&amp;</span>[u32] = <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">7</span>, <span class="number">1</span>, <span class="number">1</span>];
993 <span class="kw">let </span>num = <span class="kw-2">&amp;</span>nums[<span class="number">2</span>];
994
995 <span class="macro">assert_eq!</span>(num, <span class="kw-2">&amp;</span><span class="number">1</span>);
996 <span class="macro">assert_eq!</span>(nums.elem_offset(num), <span class="prelude-val">Some</span>(<span class="number">2</span>));</code></pre></div>
997 <p>Returning <code>None</code> with an in-between element:</p>
998
999 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(substr_range)]
1000
1001 </span><span class="kw">let </span>arr: <span class="kw-2">&amp;</span>[[u32; <span class="number">2</span>]] = <span class="kw-2">&amp;</span>[[<span class="number">0</span>, <span class="number">1</span>], [<span class="number">2</span>, <span class="number">3</span>]];
1002 <span class="kw">let </span>flat_arr: <span class="kw-2">&amp;</span>[u32] = arr.as_flattened();
1003
1004 <span class="kw">let </span>ok_elm: <span class="kw-2">&amp;</span>[u32; <span class="number">2</span>] = flat_arr[<span class="number">0</span>..<span class="number">2</span>].try_into().unwrap();
1005 <span class="kw">let </span>weird_elm: <span class="kw-2">&amp;</span>[u32; <span class="number">2</span>] = flat_arr[<span class="number">1</span>..<span class="number">3</span>].try_into().unwrap();
1006
1007 <span class="macro">assert_eq!</span>(ok_elm, <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>]);
1008 <span class="macro">assert_eq!</span>(weird_elm, <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>]);
1009
1010 <span class="macro">assert_eq!</span>(arr.elem_offset(ok_elm), <span class="prelude-val">Some</span>(<span class="number">0</span>)); <span class="comment">// Points to element 0
1011 </span><span class="macro">assert_eq!</span>(arr.elem_offset(weird_elm), <span class="prelude-val">None</span>); <span class="comment">// Points between element 0 and 1</span></code></pre></div>
1012 </div></details><details class="toggle method-toggle" open><summary><section id="method.subslice_range" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4737">Source</a><h4 class="code-header">pub fn <a href="#method.subslice_range" class="fn">subslice_range</a>(&amp;self, subslice: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>substr_range</code>)</span></div></span></summary><div class="docblock"><p>Returns the range of indices that a subslice points to.</p>
1013 <p>Returns <code>None</code> if <code>subslice</code> does not point within the slice or if it points between elements.</p>
1014 <p>This method <strong>does not compare elements</strong>. Instead, this method finds the location in the slice that
1015 <code>subslice</code> was obtained from. To find the index of a subslice via comparison, instead use
1016 <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.windows" title="method slice::windows"><code>.windows()</code></a><a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position" title="method core::iter::traits::iterator::Iterator::position"><code>.position()</code></a>.</p>
1017 <p>This method is useful for extending slice iterators like <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split" title="method slice::split"><code>slice::split</code></a>.</p>
1018 <p>Note that this may return a false positive (either <code>Some(0..0)</code> or <code>Some(self.len()..self.len())</code>)
1019 if <code>subslice</code> has a length of zero and points to the beginning or end of another, separate, slice.</p>
1020 <h5 id="panics-12"><a class="doc-anchor" href="#panics-12">§</a>Panics</h5>
1021 <p>Panics if <code>T</code> is zero-sized.</p>
1022 <h5 id="examples-54"><a class="doc-anchor" href="#examples-54">§</a>Examples</h5>
1023 <p>Basic usage:</p>
1024
1025 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(substr_range)]
1026
1027 </span><span class="kw">let </span>nums = <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">5</span>, <span class="number">10</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">5</span>];
1028
1029 <span class="kw">let </span><span class="kw-2">mut </span>iter = nums
1030 .split(|t| <span class="kw-2">*</span>t == <span class="number">0</span>)
1031 .map(|n| nums.subslice_range(n).unwrap());
1032
1033 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">0</span>..<span class="number">0</span>));
1034 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">1</span>..<span class="number">3</span>));
1035 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">4</span>..<span class="number">4</span>));
1036 <span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">5</span>..<span class="number">6</span>));</code></pre></div>
1037 </div></details><details class="toggle method-toggle" open><summary><section id="method.as_flattened" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#4787">Source</a></span><h4 class="code-header">pub fn <a href="#method.as_flattened" class="fn">as_flattened</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a></h4></section></summary><div class="docblock"><p>Takes a <code>&amp;[[T; N]]</code>, and flattens it to a <code>&amp;[T]</code>.</p>
1038 <h5 id="panics-13"><a class="doc-anchor" href="#panics-13">§</a>Panics</h5>
1039 <p>This panics if the length of the resulting slice would overflow a <code>usize</code>.</p>
1040 <p>This is only possible when flattening a slice of arrays of zero-sized
1041 types, and thus tends to be irrelevant in practice. If
1042 <code>size_of::&lt;T&gt;() &gt; 0</code>, this will never panic.</p>
1043 <h5 id="examples-55"><a class="doc-anchor" href="#examples-55">§</a>Examples</h5>
1044 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</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>]].as_flattened(), <span class="kw-2">&amp;</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>]);
1045
1046 <span class="macro">assert_eq!</span>(
1047 [[<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>]].as_flattened(),
1048 [[<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>]].as_flattened(),
1049 );
1050
1051 <span class="kw">let </span>slice_of_empty_arrays: <span class="kw-2">&amp;</span>[[i32; <span class="number">0</span>]] = <span class="kw-2">&amp;</span>[[], [], [], [], []];
1052 <span class="macro">assert!</span>(slice_of_empty_arrays.as_flattened().is_empty());
1053
1054 <span class="kw">let </span>empty_slice_of_arrays: <span class="kw-2">&amp;</span>[[u32; <span class="number">10</span>]] = <span class="kw-2">&amp;</span>[];
1055 <span class="macro">assert!</span>(empty_slice_of_arrays.as_flattened().is_empty());</code></pre></div>
1056 </div></details><details class="toggle method-toggle" open><summary><section id="method.utf8_chunks" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.79.0">1.79.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/lossy.rs.html#44">Source</a></span><h4 class="code-header">pub fn <a href="#method.utf8_chunks" class="fn">utf8_chunks</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/lossy/struct.Utf8Chunks.html" title="struct core::str::lossy::Utf8Chunks">Utf8Chunks</a>&lt;'_&gt; <a href="#" class="tooltip" data-notable-ty="Utf8Chunks&lt;&#39;_&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Creates an iterator over the contiguous valid UTF-8 ranges of this
1057 slice, and the non-UTF-8 fragments in between.</p>
1058 <p>See the <a href="https://doc.rust-lang.org/nightly/core/str/lossy/struct.Utf8Chunk.html" title="struct core::str::lossy::Utf8Chunk"><code>Utf8Chunk</code></a> type for documenation of the items yielded by this iterator.</p>
1059 <h5 id="examples-56"><a class="doc-anchor" href="#examples-56">§</a>Examples</h5>
1060 <p>This function formats arbitrary but mostly-UTF-8 bytes into Rust source
1061 code in the form of a C-string literal (<code>c"..."</code>).</p>
1062
1063 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::fmt::Write <span class="kw">as _</span>;
1064
1065 <span class="kw">pub fn </span>cstr_literal(bytes: <span class="kw-2">&amp;</span>[u8]) -&gt; String {
1066 <span class="kw">let </span><span class="kw-2">mut </span>repr = String::new();
1067 repr.push_str(<span class="string">"c\""</span>);
1068 <span class="kw">for </span>chunk <span class="kw">in </span>bytes.utf8_chunks() {
1069 <span class="kw">for </span>ch <span class="kw">in </span>chunk.valid().chars() {
1070 <span class="comment">// Escapes \0, \t, \r, \n, \\, \', \", and uses \u{...} for non-printable characters.
1071 </span><span class="macro">write!</span>(repr, <span class="string">"{}"</span>, ch.escape_debug()).unwrap();
1072 }
1073 <span class="kw">for </span>byte <span class="kw">in </span>chunk.invalid() {
1074 <span class="macro">write!</span>(repr, <span class="string">"\\x{:02X}"</span>, byte).unwrap();
1075 }
1076 }
1077 repr.push(<span class="string">'"'</span>);
1078 repr
1079 }
1080
1081 <span class="kw">fn </span>main() {
1082 <span class="kw">let </span>lit = cstr_literal(<span class="string">b"\xferris the \xf0\x9f\xa6\x80\x07"</span>);
1083 <span class="kw">let </span>expected = <span class="macro">stringify!</span>(<span class="string">c"\xFErris the 🦀\u{7}"</span>);
1084 <span class="macro">assert_eq!</span>(lit, expected);
1085 }</code></pre></div>
1086 </div></details><details class="toggle method-toggle" open><summary><section id="method.to_vec" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#475-477">Source</a></span><h4 class="code-header">pub fn <a href="#method.to_vec" class="fn">to_vec</a>(&amp;self) -&gt; <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;T&gt;<div class="where">where
1087 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Copies <code>self</code> into a new <code>Vec</code>.</p>
1088 <h5 id="examples-57"><a class="doc-anchor" href="#examples-57">§</a>Examples</h5>
1089 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
1090 <span class="kw">let </span>x = s.to_vec();
1091 <span class="comment">// Here, `s` and `x` can be modified independently.</span></code></pre></div>
1092 </div></details><details class="toggle method-toggle" open><summary><section id="method.to_vec_in" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#499-501">Source</a><h4 class="code-header">pub fn <a href="#method.to_vec_in" class="fn">to_vec_in</a>&lt;A&gt;(&amp;self, alloc: A) -&gt; <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;T, A&gt;<div class="where">where
1093 A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>,
1094 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Copies <code>self</code> into a new <code>Vec</code> with an allocator.</p>
1095 <h5 id="examples-58"><a class="doc-anchor" href="#examples-58">§</a>Examples</h5>
1096 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(allocator_api)]
1097
1098 </span><span class="kw">use </span>std::alloc::System;
1099
1100 <span class="kw">let </span>s = [<span class="number">10</span>, <span class="number">40</span>, <span class="number">30</span>];
1101 <span class="kw">let </span>x = s.to_vec_in(System);
1102 <span class="comment">// Here, `s` and `x` can be modified independently.</span></code></pre></div>
1103 </div></details><details class="toggle method-toggle" open><summary><section id="method.repeat" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.40.0">1.40.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#553-555">Source</a></span><h4 class="code-header">pub fn <a href="#method.repeat" class="fn">repeat</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;T&gt;<div class="where">where
1104 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,</div></h4></section></summary><div class="docblock"><p>Creates a vector by copying a slice <code>n</code> times.</p>
1105 <h5 id="panics-14"><a class="doc-anchor" href="#panics-14">§</a>Panics</h5>
1106 <p>This function will panic if the capacity would overflow.</p>
1107 <h5 id="examples-59"><a class="doc-anchor" href="#examples-59">§</a>Examples</h5>
1108 <p>Basic usage:</p>
1109
1110 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>([<span class="number">1</span>, <span class="number">2</span>].repeat(<span class="number">3</span>), <span class="macro">vec!</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>]);</code></pre></div>
1111 <p>A panic upon overflow:</p>
1112
1113 <div class="example-wrap should_panic"><a href="#" class="tooltip" title="This example panics">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="comment">// this will panic at runtime
1114 </span><span class="string">b"0123456789abcdef"</span>.repeat(usize::MAX);</code></pre></div>
1115 </div></details><details class="toggle method-toggle" open><summary><section id="method.concat" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#621-623">Source</a></span><h4 class="code-header">pub fn <a href="#method.concat" class="fn">concat</a>&lt;Item&gt;(&amp;self) -&gt; &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Concat.html" title="trait alloc::slice::Concat">Concat</a>&lt;Item&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Concat.html#associatedtype.Output" title="type alloc::slice::Concat::Output">Output</a> <a href="#" class="tooltip" data-notable-ty="&lt;[T] as Concat&lt;Item&gt;&gt;::Output">ⓘ</a><div class="where">where
1116 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Concat.html" title="trait alloc::slice::Concat">Concat</a>&lt;Item&gt;,
1117 Item: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>.</p>
1118 <h5 id="examples-60"><a class="doc-anchor" href="#examples-60">§</a>Examples</h5>
1119 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>([<span class="string">"hello"</span>, <span class="string">"world"</span>].concat(), <span class="string">"helloworld"</span>);
1120 <span class="macro">assert_eq!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].concat(), [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>]);</code></pre></div>
1121 </div></details><details class="toggle method-toggle" open><summary><section id="method.join" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#640-642">Source</a></span><h4 class="code-header">pub fn <a href="#method.join" class="fn">join</a>&lt;Separator&gt;(
1122 &amp;self,
1123 sep: Separator,
1124 ) -&gt; &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a>&lt;Separator&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html#associatedtype.Output" title="type alloc::slice::Join::Output">Output</a> <a href="#" class="tooltip" data-notable-ty="&lt;[T] as Join&lt;Separator&gt;&gt;::Output">ⓘ</a><div class="where">where
1125 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a>&lt;Separator&gt;,</div></h4></section></summary><div class="docblock"><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>, placing a
1126 given separator between each.</p>
1127 <h5 id="examples-61"><a class="doc-anchor" href="#examples-61">§</a>Examples</h5>
1128 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>([<span class="string">"hello"</span>, <span class="string">"world"</span>].join(<span class="string">" "</span>), <span class="string">"hello world"</span>);
1129 <span class="macro">assert_eq!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].join(<span class="kw-2">&amp;</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>]);
1130 <span class="macro">assert_eq!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].join(<span class="kw-2">&amp;</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>]);</code></pre></div>
1131 </div></details><details class="toggle method-toggle" open><summary><section id="method.connect" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#660-662">Source</a></span><h4 class="code-header">pub fn <a href="#method.connect" class="fn">connect</a>&lt;Separator&gt;(
1132 &amp;self,
1133 sep: Separator,
1134 ) -&gt; &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a>&lt;Separator&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html#associatedtype.Output" title="type alloc::slice::Join::Output">Output</a> <a href="#" class="tooltip" data-notable-ty="&lt;[T] as Join&lt;Separator&gt;&gt;::Output">ⓘ</a><div class="where">where
1135 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/slice/trait.Join.html" title="trait alloc::slice::Join">Join</a>&lt;Separator&gt;,</div></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.3.0: renamed to join</span></div></span></summary><div class="docblock"><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>, placing a
1136 given separator between each.</p>
1137 <h5 id="examples-62"><a class="doc-anchor" href="#examples-62">§</a>Examples</h5>
1138 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>([<span class="string">"hello"</span>, <span class="string">"world"</span>].connect(<span class="string">" "</span>), <span class="string">"hello world"</span>);
1139 <span class="macro">assert_eq!</span>([[<span class="number">1</span>, <span class="number">2</span>], [<span class="number">3</span>, <span class="number">4</span>]].connect(<span class="kw-2">&amp;</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>]);</code></pre></div>
1140 </div></details><details class="toggle method-toggle" open><summary><section id="method.to_ascii_uppercase" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.23.0">1.23.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#685">Source</a></span><h4 class="code-header">pub fn <a href="#method.to_ascii_uppercase" class="fn">to_ascii_uppercase</a>(&amp;self) -&gt; <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt; <a href="#" class="tooltip" data-notable-ty="Vec&lt;u8&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns a vector containing a copy of this slice where each byte
1141 is mapped to its ASCII upper case equivalent.</p>
1142 <p>ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’,
1143 but non-ASCII letters are unchanged.</p>
1144 <p>To uppercase the value in-place, use <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.make_ascii_uppercase" title="method slice::make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
1145 </div></details><details class="toggle method-toggle" open><summary><section id="method.to_ascii_lowercase" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.23.0">1.23.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#706">Source</a></span><h4 class="code-header">pub fn <a href="#method.to_ascii_lowercase" class="fn">to_ascii_lowercase</a>(&amp;self) -&gt; <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt; <a href="#" class="tooltip" data-notable-ty="Vec&lt;u8&gt;">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns a vector containing a copy of this slice where each byte
1146 is mapped to its ASCII lower case equivalent.</p>
1147 <p>ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’,
1148 but non-ASCII letters are unchanged.</p>
1149 <p>To lowercase the value in-place, use <a href="https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.make_ascii_lowercase" title="method slice::make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
1150 </div></details></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3C%5Bu8%5D%3E-for-SerializedSignature" class="impl"><a href="#impl-AsRef%3C%5Bu8%5D%3E-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref" class="method trait-impl"><a href="#method.as_ref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Borrow%3C%5Bu8%5D%3E-for-SerializedSignature" class="impl"><a href="#impl-Borrow%3C%5Bu8%5D%3E-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-SerializedSignature" class="impl"><a href="#impl-Clone-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&amp;self) -&gt; <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-SerializedSignature" class="impl"><a href="#impl-Debug-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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>&gt;</h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-SerializedSignature" class="impl"><a href="#impl-Deref-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&amp;self) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&amp;[u8]">ⓘ</a></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-SerializedSignature" class="impl"><a href="#impl-Display-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl"><a href="#method.fmt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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>&gt;</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%26Signature%3E-for-SerializedSignature" class="impl"><a href="#impl-From%3C%26Signature%3E-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;&amp;'a <a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>&gt; for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: &amp;'a <a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>) -&gt; <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CSignature%3E-for-SerializedSignature" class="impl"><a href="#impl-From%3CSignature%3E-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>&gt; for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: <a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>) -&gt; <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Hash-for-SerializedSignature" class="impl"><a href="#impl-Hash-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl"><a href="#method.hash" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fn">hash</a>&lt;H&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut H</a>)<div class="where">where
1151 H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,</div></h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#235-237">Source</a></span><a href="#method.hash_slice" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fn">hash_slice</a>&lt;H&gt;(data: &amp;[Self], state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut H</a>)<div class="where">where
1152 H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,
1153 Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26SerializedSignature" class="impl"><a href="#impl-IntoIterator-for-%26SerializedSignature" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <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 &amp;'a <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.IntoIter-1" class="associatedtype trait-impl"><a href="#associatedtype.IntoIter-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/slice/iter/struct.Iter.html" title="struct core::slice::iter::Iter">Iter</a>&lt;'a, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;</h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="toggle" open><summary><section id="associatedtype.Item-1" class="associatedtype trait-impl"><a href="#associatedtype.Item-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_iter-1" class="method trait-impl"><a href="#method.into_iter-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fn">into_iter</a>(self) -&gt; &lt;&amp;'a <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</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>&gt;::<a class="associatedtype" 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></h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-SerializedSignature" class="impl"><a href="#impl-IntoIterator-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.IntoIter" class="associatedtype trait-impl"><a href="#associatedtype.IntoIter" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <a class="struct" href="struct.IntoIter.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::serialized_signature::IntoIter">IntoIter</a></h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl"><a href="#method.into_iter" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fn">into_iter</a>(self) -&gt; &lt;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</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>&gt;::<a class="associatedtype" 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></h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-SerializedSignature" class="impl"><a href="#impl-Ord-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> 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></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#980-982">Source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -&gt; Self<div class="where">where
1154 Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>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></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1001-1003">Source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -&gt; Self<div class="where">where
1155 Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>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></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1027-1029">Source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -&gt; Self<div class="where">where
1156 Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%5Bu8%5D%3E-for-SerializedSignature" class="impl"><a href="#impl-PartialEq%3C%5Bu8%5D%3E-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-1" class="method trait-impl"><a href="#method.eq-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&amp;self, other: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
1157 and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CSerializedSignature%3E-for-%5Bu8%5D" class="impl"><a href="#impl-PartialEq%3CSerializedSignature%3E-for-%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>&gt; for [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-2" class="method trait-impl"><a href="#method.eq-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&amp;self, other: &amp;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
1158 and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-SerializedSignature" class="impl"><a href="#impl-PartialEq-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&amp;self, other: &amp;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
1159 and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd%3C%5Bu8%5D%3E-for-SerializedSignature" class="impl"><a href="#impl-PartialOrd%3C%5Bu8%5D%3E-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp-1" class="method trait-impl"><a href="#method.partial_cmp-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&amp;self, other: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</h4></section></summary><div class='docblock'>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></div></details><details class="toggle method-toggle" open><summary><section id="method.lt-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1335">Source</a></span><a href="#method.lt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1353">Source</a></span><a href="#method.le-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
1160 <code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1371">Source</a></span><a href="#method.gt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code>
1161 operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1389">Source</a></span><a href="#method.ge-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
1162 the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd%3CSerializedSignature%3E-for-%5Bu8%5D" class="impl"><a href="#impl-PartialOrd%3CSerializedSignature%3E-for-%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>&gt; for [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp-2" class="method trait-impl"><a href="#method.partial_cmp-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</h4></section></summary><div class='docblock'>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></div></details><details class="toggle method-toggle" open><summary><section id="method.lt-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1335">Source</a></span><a href="#method.lt-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1353">Source</a></span><a href="#method.le-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
1163 <code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1371">Source</a></span><a href="#method.gt-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code>
1164 operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1389">Source</a></span><a href="#method.ge-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
1165 the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-SerializedSignature" class="impl"><a href="#impl-PartialOrd-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</h4></section></summary><div class='docblock'>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></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1335">Source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1353">Source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
1166 <code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1371">Source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code>
1167 operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1389">Source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
1168 the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26SerializedSignature%3E-for-Signature" class="impl"><a href="#impl-TryFrom%3C%26SerializedSignature%3E-for-Signature" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>&gt; for <a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="../../enum.Error.html" title="enum bdk_chain::bitcoin::secp256k1::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-1" class="method trait-impl"><a href="#method.try_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(
1169 value: &amp;'a <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>,
1170 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>, &lt;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CSerializedSignature%3E-for-Signature" class="impl"><a href="#impl-TryFrom%3CSerializedSignature%3E-for-Signature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>&gt; for <a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="../../enum.Error.html" title="enum bdk_chain::bitcoin::secp256k1::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(
1171 value: <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>,
1172 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a>, &lt;<a class="struct" href="../struct.Signature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::Signature">Signature</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><section id="impl-Copy-for-SerializedSignature" class="impl"><a href="#impl-Copy-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section><section id="impl-Eq-for-SerializedSignature" class="impl"><a href="#impl-Eq-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-SerializedSignature" class="impl"><a href="#impl-Freeze-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section><section id="impl-RefUnwindSafe-for-SerializedSignature" class="impl"><a href="#impl-RefUnwindSafe-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section><section id="impl-Send-for-SerializedSignature" class="impl"><a href="#impl-Send-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section><section id="impl-Sync-for-SerializedSignature" class="impl"><a href="#impl-Sync-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section><section id="impl-Unpin-for-SerializedSignature" class="impl"><a href="#impl-Unpin-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">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="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section><section id="impl-UnwindSafe-for-SerializedSignature" class="impl"><a href="#impl-UnwindSafe-for-SerializedSignature" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../struct.SerializedSignature.html" title="struct bdk_chain::bitcoin::secp256k1::ecdsa::SerializedSignature">SerializedSignature</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
1173 T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
1174 T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
1175 T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
1176 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&amp;self, dst: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Equivalent%3CK%3E-for-Q" class="impl"><a href="#impl-Equivalent%3CK%3E-for-Q" class="anchor">§</a><h3 class="code-header">impl&lt;Q, K&gt; Equivalent&lt;K&gt; for Q<div class="where">where
1177 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>,
1178 K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;Q&gt; + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.equivalent" class="method trait-impl"><a href="#method.equivalent" class="anchor">§</a><h4 class="code-header">fn <a class="fn">equivalent</a>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;K</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Checks if this value is equivalent to the given key. <a>Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#770">Source</a><a href="#method.from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
1179 </div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#750-752">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
1180 U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#760">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
1181 <p>That is, this conversion is whatever the implementation of
1182 <code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
1183 </div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Receiver-for-P" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#418-420">Source</a><a href="#impl-Receiver-for-P" class="anchor">§</a><h3 class="code-header">impl&lt;P, T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Receiver.html" title="trait core::ops::deref::Receiver">Receiver</a> for P<div class="where">where
1184 P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a>&lt;Target = T&gt; + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
1185 T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#422">Source</a><a href="#associatedtype.Target-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Receiver.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>arbitrary_self_types</code>)</span></div></span><div class='docblock'>The target type on which the method may be called.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
1186 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>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></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut T</a>)</h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToString-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2677">Source</a><a href="#impl-ToString-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T<div class="where">where
1187 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_string" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2679">Source</a><a href="#method.to_string" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fn">to_string</a>(&amp;self) -&gt; <a class="struct" href="../../../base58/struct.String.html" title="struct bdk_chain::bitcoin::base58::String">String</a></h4></section></summary><div class='docblock'>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#807-809">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
1188 U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811">Source</a><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-2" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#814">Source</a><a href="#method.try_from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#792-794">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
1189 U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#796">Source</a><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#799">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E-for-T" class="impl"><a href="#impl-VZip%3CV%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;V, T&gt; VZip&lt;V&gt; for T<div class="where">where
1190 V: MultiLane&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl"><a href="#method.vzip" class="anchor">§</a><h4 class="code-header">fn <a class="fn">vzip</a>(self) -&gt; V</h4></section></div></details></div><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div>","<[T] as Concat<Item>>::Output":"<h3>Notable traits for <code>&amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for &amp;mut [<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div>","<[T] as Join<Separator>>::Output":"<h3>Notable traits for <code>&amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for &amp;mut [<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div>","ArrayChunks<'_, T, N>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ArrayChunks.html\" title=\"struct core::slice::iter::ArrayChunks\">ArrayChunks</a>&lt;'a, T, N&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, const N: <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.usize.html\">usize</a>&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ArrayChunks.html\" title=\"struct core::slice::iter::ArrayChunks\">ArrayChunks</a>&lt;'a, T, N&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.array.html\">[T; N]</a>;</div>","ArrayWindows<'_, T, N>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ArrayWindows.html\" title=\"struct core::slice::iter::ArrayWindows\">ArrayWindows</a>&lt;'a, T, N&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, const N: <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.usize.html\">usize</a>&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ArrayWindows.html\" title=\"struct core::slice::iter::ArrayWindows\">ArrayWindows</a>&lt;'a, T, N&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.array.html\">[T; N]</a>;</div>","ChunkBy<'_, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ChunkBy.html\" title=\"struct core::slice::iter::ChunkBy\">ChunkBy</a>&lt;'a, T, P&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, P&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ChunkBy.html\" title=\"struct core::slice::iter::ChunkBy\">ChunkBy</a>&lt;'a, T, P&gt;<div class=\"where\">where\n T: 'a,\n P: <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\">&amp;T</a>, <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.reference.html\">&amp;T</a>) -&gt; <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","Chunks<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Chunks.html\" title=\"struct core::slice::iter::Chunks\">Chunks</a>&lt;'a, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Chunks.html\" title=\"struct core::slice::iter::Chunks\">Chunks</a>&lt;'a, T&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","ChunksExact<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ChunksExact.html\" title=\"struct core::slice::iter::ChunksExact\">ChunksExact</a>&lt;'a, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.ChunksExact.html\" title=\"struct core::slice::iter::ChunksExact\">ChunksExact</a>&lt;'a, T&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","EscapeAscii<'_>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/ascii/struct.EscapeAscii.html\" title=\"struct core::slice::ascii::EscapeAscii\">EscapeAscii</a>&lt;'a&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/ascii/struct.EscapeAscii.html\" title=\"struct core::slice::ascii::EscapeAscii\">EscapeAscii</a>&lt;'a&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>;</div>","Iter<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Iter.html\" title=\"struct core::slice::iter::Iter\">Iter</a>&lt;'a, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Iter.html\" title=\"struct core::slice::iter::Iter\">Iter</a>&lt;'a, T&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.reference.html\">&amp;'a T</a>;</div>","RChunks<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RChunks.html\" title=\"struct core::slice::iter::RChunks\">RChunks</a>&lt;'a, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RChunks.html\" title=\"struct core::slice::iter::RChunks\">RChunks</a>&lt;'a, T&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","RChunksExact<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RChunksExact.html\" title=\"struct core::slice::iter::RChunksExact\">RChunksExact</a>&lt;'a, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RChunksExact.html\" title=\"struct core::slice::iter::RChunksExact\">RChunksExact</a>&lt;'a, T&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","RSplit<'_, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RSplit.html\" title=\"struct core::slice::iter::RSplit\">RSplit</a>&lt;'a, T, P&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, P&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RSplit.html\" title=\"struct core::slice::iter::RSplit\">RSplit</a>&lt;'a, T, P&gt;<div class=\"where\">where\n P: <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\">&amp;T</a>) -&gt; <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","RSplitN<'_, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RSplitN.html\" title=\"struct core::slice::iter::RSplitN\">RSplitN</a>&lt;'a, T, P&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, P&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.RSplitN.html\" title=\"struct core::slice::iter::RSplitN\">RSplitN</a>&lt;'a, T, P&gt;<div class=\"where\">where\n P: <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\">&amp;T</a>) -&gt; <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","Range<*const T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html\" title=\"struct core::ops::range::Range\">Range</a>&lt;A&gt;</code></h3><pre><code><div class=\"where\">impl&lt;A&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html\" title=\"struct core::ops::range::Range\">Range</a>&lt;A&gt;<div class=\"where\">where\n A: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/range/trait.Step.html\" title=\"trait core::iter::range::Step\">Step</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = A;</div>","Split<'_, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Split.html\" title=\"struct core::slice::iter::Split\">Split</a>&lt;'a, T, P&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, P&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Split.html\" title=\"struct core::slice::iter::Split\">Split</a>&lt;'a, T, P&gt;<div class=\"where\">where\n P: <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\">&amp;T</a>) -&gt; <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","SplitInclusive<'_, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.SplitInclusive.html\" title=\"struct core::slice::iter::SplitInclusive\">SplitInclusive</a>&lt;'a, T, P&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, P&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.SplitInclusive.html\" title=\"struct core::slice::iter::SplitInclusive\">SplitInclusive</a>&lt;'a, T, P&gt;<div class=\"where\">where\n P: <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\">&amp;T</a>) -&gt; <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","SplitN<'_, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.SplitN.html\" title=\"struct core::slice::iter::SplitN\">SplitN</a>&lt;'a, T, P&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, P&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.SplitN.html\" title=\"struct core::slice::iter::SplitN\">SplitN</a>&lt;'a, T, P&gt;<div class=\"where\">where\n P: <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\">&amp;T</a>) -&gt; <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>","Utf8Chunks<'_>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/str/lossy/struct.Utf8Chunks.html\" title=\"struct core::str::lossy::Utf8Chunks\">Utf8Chunks</a>&lt;'a&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/str/lossy/struct.Utf8Chunks.html\" title=\"struct core::str::lossy::Utf8Chunks\">Utf8Chunks</a>&lt;'a&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/str/lossy/struct.Utf8Chunk.html\" title=\"struct core::str::lossy::Utf8Chunk\">Utf8Chunk</a>&lt;'a&gt;;</div>","Vec<u8>":"<h3>Notable traits for <code><a class=\"struct\" href=\"../../../base58/struct.Vec.html\" title=\"struct bdk_chain::bitcoin::base58::Vec\">Vec</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A&gt;</code></h3><pre><code><div class=\"where\">impl&lt;A&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"../../../base58/struct.Vec.html\" title=\"struct bdk_chain::bitcoin::base58::Vec\">Vec</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A&gt;<div class=\"where\">where\n A: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/alloc/trait.Allocator.html\" title=\"trait core::alloc::Allocator\">Allocator</a>,</div></div>","Windows<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Windows.html\" title=\"struct core::slice::iter::Windows\">Windows</a>&lt;'a, T&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T&gt; <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> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/slice/iter/struct.Windows.html\" title=\"struct core::slice::iter::Windows\">Windows</a>&lt;'a, T&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[T]</a>;</div>"}</script></section></div></main></body></html>