<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="A structure to wrap an intermediate buffer used by libgit2."><title>Buf in git2 - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../static.files/rustdoc-5bc39a1768837dd0.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="git2"data-themes=""data-resource-suffix=""data-rustdoc-version="1.77.2 (25ef9e3d8 2024-04-09)"data-channel="1.77.2"data-search-js="search-dd67cee4cfa65049.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../static.files/storage-4c98445ec4002617.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-48f368f3872407c8.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-04d5337699b92874.css"></noscript><linkrel="alternate icon"type="image/png"href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle"title="show sidebar"></button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../git2/index.html">git2</a><spanclass="version">0.18.3</span></h2></div><h2class="location"><ahref="#">Buf</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.as_str">as_str</a></li><li><ahref="#method.new">new</a></li></ul><h3><ahref="#deref-methods-%5Bu8%5D">Methods from Deref<Target=[u8]></a></h3><ulclass="block deref-methods"><li><ahref="#method.align_to">align_to</a></li><li><ahref="#method.align_to_mut">align_to_mut</a></li><li><ahref="#method.array_chunks">array_chunks</a></li><li><ahref="#method.array_chunks_mut">array_chunks_mut</a></li><li><ahref="#method.array_windows">array_windows</a></li><li><ahref="#method.as_ascii">as_ascii</a></li><li><ahref="#method.as_ascii_unchecked">as_ascii_unchecked</a></li><li><ahref="#method.as_bytes">as_bytes</a></li><li><ahref="#method.as_chunks">as_chunks</a></li><li><ahref="#method.as_chunks_mut">as_chunks_mut</a></li><li><ahref="#method.as_chunks_unchecked">as_chunks_unchecked</a></li><li><ahref="#method.as_chunks_unchecked_mut">as_chunks_unchecked_mut</a></li><li><ahref="#method.as_mut_ptr">as_mut_ptr</a></li><li><ahref="#method.as_mut_ptr_range">as_mut_ptr_range</a></li><li><ahref="#method.as_ptr">as_ptr</a></li><li><ahref="#method.as_ptr_range">as_ptr_range</a></li><li><ahref="#method.as_rchunks">as_rchunks</a></li><li><ahref="#method.as_rchunks_mut">as_rchunks_mut</a></li><li><ahref="#method.as_simd">as_simd</a></li><li><ahref="#method.as_simd_mut">as_simd_mut</a></li><li><ahref="#method.as_str-1">as_str</a></li><li><ahref="#method.binary_search">binary_search</a></li><li><ahref="#method.binary_search_by">binary_search_by</a></li><li><ahref="#method.binary_search_by_key">binary_sea
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../git2/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Struct <ahref="index.html">git2</a>::<wbr><aclass="struct"href="#">Buf</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../src/git2/buf.rs.html#13-15">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Buf { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A structure to wrap an intermediate buffer used by libgit2.</p>
<p>A buffer can be thought of a <code>Vec<u8></code>, but the <code>Vec</code> type is not used to
avoid copying data back and forth.</p>
</div></details><h2id="implementations"class="section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Buf"class="impl"><aclass="src rightside"href="../src/git2/buf.rs.html#23-42">source</a><ahref="#impl-Buf"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.Buf.html"title="struct git2::Buf">Buf</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../src/git2/buf.rs.html#25-34">source</a><h4class="code-header">pub fn <ahref="#method.new"class="fn">new</a>() -><aclass="struct"href="struct.Buf.html"title="struct git2::Buf">Buf</a></h4></section></summary><divclass="docblock"><p>Creates a new empty buffer.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_str"class="method"><aclass="src rightside"href="../src/git2/buf.rs.html#39-41">source</a><h4class="code-header">pub fn <ahref="#method.as_str"class="fn">as_str</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.str.html">str</a>></h4></section></summary><divclass="docblock"><p>Attempt to view this buffer as a string slice.</p>
</div></details></div></details></div><h2id="deref-methods-%5Bu8%5D"class="section-header"><span>Methods from <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/deref/trait.Deref.html"title="trait core::ops::deref::Deref">Deref</a><Target = [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>]></span><ahref="#deref-methods-%5Bu8%5D"class="anchor">§</a></h2><divid="deref-methods-%5Bu8%5D-1"class="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_floats"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4621">source</a><h4class="code-header">pub fn <ahref="#method.sort_floats"class="fn">sort_floats</a>(&mut self)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>sort_floats</code>)</span></div></span></summary><divclass="docblock"><p>Sorts the slice of floats.</p>
the ordering defined by <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.f64.html#method.total_cmp"title="method f64::total_cmp"><code>f64::total_cmp</code></a>.</p>
<p>This uses the same sorting algorithm as <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable_by"title="method slice::sort_unstable_by"><code>sort_unstable_by</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.len"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#138">source</a></span><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the number of elements in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#154">source</a></span><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if the slice has a length of 0.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#173">source</a></span><h4class="code-header">pub fn <ahref="#method.first"class="fn">first</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>></h4></section></summary><divclass="docblock"><p>Returns the first element of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#193">source</a></span><h4class="code-header">pub fn <ahref="#method.first_mut"class="fn">first_mut</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>></h4></section></summary><divclass="docblock"><p>Returns a mutable pointer to the first element of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_first"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#213">source</a></span><h4class="code-header">pub fn <ahref="#method.split_first"class="fn">split_first</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section></summary><divclass="docblock"><p>Returns the first and all the rest of the elements of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_first_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#235">source</a></span><h4class="code-header">pub fn <ahref="#method.split_first_mut"class="fn">split_first_mut</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section></summary><divclass="docblock"><p>Returns the first and all the rest of the elements of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_last"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#255">source</a></span><h4class="code-header">pub fn <ahref="#method.split_last"class="fn">split_last</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section></summary><divclass="docblock"><p>Returns the last and all the rest of the elements of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_last_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#277">source</a></span><h4class="code-header">pub fn <ahref="#method.split_last_mut"class="fn">split_last_mut</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section></summary><divclass="docblock"><p>Returns the last and all the rest of the elements of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.last"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#296">source</a></span><h4class="code-header">pub fn <ahref="#method.last"class="fn">last</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>></h4></section></summary><divclass="docblock"><p>Returns the last element of the slice, or <code>None</code> if it is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.last_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#316">source</a></span><h4class="code-header">pub fn <ahref="#method.last_mut"class="fn">last_mut</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to the last item in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first_chunk"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#339">source</a></span><h4class="code-header">pub fn <ahref="#method.first_chunk"class="fn">first_chunk</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>></h4></section></summary><divclass="docblock"><p>Return an array reference to the first <code>N</code> items in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first_chunk_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#369">source</a></span><h4class="code-header">pub fn <ahref="#method.first_chunk_mut"class="fn">first_chunk_mut</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>></h4></section></summary><divclass="docblock"><p>Return a mutable array reference to the first <code>N</code> items in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_first_chunk"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#399">source</a></span><h4class="code-header">pub fn <ahref="#method.split_first_chunk"class="fn">split_first_chunk</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section></summary><divclass="docblock"><p>Return an array reference to the first <code>N</code> items in the slice and the remaining slice.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section></summary><divclass="docblock"><p>Return a mutable array reference to the first <code>N</code> items in the slice and the remaining
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_last_chunk"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#469">source</a></span><h4class="code-header">pub fn <ahref="#method.split_last_chunk"class="fn">split_last_chunk</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>)></h4></section></summary><divclass="docblock"><p>Return an array reference to the last <code>N</code> items in the slice and the remaining slice.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>)></h4></section></summary><divclass="docblock"><p>Return a mutable array reference to the last <code>N</code> items in the slice and the remaining
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.last_chunk"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#539">source</a></span><h4class="code-header">pub fn <ahref="#method.last_chunk"class="fn">last_chunk</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>></h4></section></summary><divclass="docblock"><p>Return an array reference to the last <code>N</code> items in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.last_chunk_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#573">source</a></span><h4class="code-header">pub fn <ahref="#method.last_chunk_mut"class="fn">last_chunk_mut</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>></h4></section></summary><divclass="docblock"><p>Return a mutable array reference to the last <code>N</code> items in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#608-610">source</a></span><h4class="code-header">pub fn <ahref="#method.get"class="fn">get</a><I>(&self, index: I) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<I as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a>><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a reference to an element or subslice depending on the type of
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#633-635">source</a></span><h4class="code-header">pub fn <ahref="#method.get_mut"class="fn">get_mut</a><I>(
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&mut <I as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a>><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to an element or subslice depending on the
type of index (see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.get"title="method slice::get"><code>get</code></a>) or <code>None</code> if the index is out of bounds.</p>
) ->&<I as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a reference to an element or subslice, without doing bounds
<p>For a safe alternative see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.get"title="method slice::get"><code>get</code></a>.</p>
<p>Calling this method with an out-of-bounds index is <em><ahref="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>
even if the resulting reference is not used.</p>
<p>You can think of this like <code>.get(index).unwrap_unchecked()</code>. It’s UB
to call <code>.get_unchecked(len)</code>, even if you immediately convert to a
pointer. And it’s UB to call <code>.get_unchecked(..len + 1)</code>,
<code>.get_unchecked(..=len)</code>, or similar.</p>
) ->&mut <I as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to an element or subslice, without doing
<p>For a safe alternative see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.get_mut"title="method slice::get_mut"><code>get_mut</code></a>.</p>
<p>Calling this method with an out-of-bounds index is <em><ahref="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>
even if the resulting reference is not used.</p>
<p>You can think of this like <code>.get_mut(index).unwrap_unchecked()</code>. It’s
UB to call <code>.get_unchecked_mut(len)</code>, even if you immediately convert
to a pointer. And it’s UB to call <code>.get_unchecked_mut(..len + 1)</code>,
<code>.get_unchecked_mut(..=len)</code>, or similar.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#753">source</a></span><h4class="code-header">pub fn <ahref="#method.as_ptr"class="fn">as_ptr</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.pointer.html">*const T</a></h4></section></summary><divclass="docblock"><p>Returns a raw pointer to the slice’s buffer.</p>
derived from it. If you need to mutate the contents of the slice, use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.as_mut_ptr"title="method slice::as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_ptr"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#784">source</a></span><h4class="code-header">pub fn <ahref="#method.as_mut_ptr"class="fn">as_mut_ptr</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.pointer.html">*mut T</a></h4></section></summary><divclass="docblock"><p>Returns an unsafe mutable pointer to the slice’s buffer.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr_range"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.48.0">1.48.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#820">source</a></span><h4class="code-header">pub fn <ahref="#method.as_ptr_range"class="fn">as_ptr_range</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/ops/range/struct.Range.html"title="struct core::ops::range::Range">Range</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.pointer.html">*const T</a>></h4></section></summary><divclass="docblock"><p>Returns the two raw pointers spanning the slice.</p>
<p>See <ahref="https://doc.rust-lang.org/1.77.2/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
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_ptr_range"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.48.0">1.48.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#864">source</a></span><h4class="code-header">pub fn <ahref="#method.as_mut_ptr_range"class="fn">as_mut_ptr_range</a>(&mut self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/ops/range/struct.Range.html"title="struct core::ops::range::Range">Range</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.pointer.html">*mut T</a>></h4></section></summary><divclass="docblock"><p>Returns the two unsafe mutable pointers spanning the slice.</p>
<p>See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.as_mut_ptr"title="method slice::as_mut_ptr"><code>as_mut_ptr</code></a> for warnings on using these pointers. The end
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#895">source</a></span><h4class="code-header">pub fn <ahref="#method.swap"class="fn">swap</a>(&mut self, a: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, b: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Swaps two elements in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_unchecked"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#938">source</a><h4class="code-header">pub unsafe fn <ahref="#method.swap_unchecked"class="fn">swap_unchecked</a>(&mut self, a: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, b: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_swap_unchecked</code>)</span></div></span></summary><divclass="docblock"><p>Swaps two elements in the slice, without doing bounds checking.</p>
<p>For a safe alternative see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.swap"title="method slice::swap"><code>swap</code></a>.</p>
<p>Calling this method with an out-of-bounds index is <em><ahref="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>.
The caller has to ensure that <code>a < self.len()</code> and <code>b < self.len()</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.reverse"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#962">source</a></span><h4class="code-header">pub fn <ahref="#method.reverse"class="fn">reverse</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Reverses the order of elements in the slice, in place.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.iter"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1020">source</a></span><h4class="code-header">pub fn <ahref="#method.iter"class="fn">iter</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.Iter.html"title="struct core::slice::iter::Iter">Iter</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.iter_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1039">source</a></span><h4class="code-header">pub fn <ahref="#method.iter_mut"class="fn">iter_mut</a>(&mut self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.IterMut.html"title="struct core::slice::iter::IterMut">IterMut</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator that allows modifying each value.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.windows"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1088">source</a></span><h4class="code-header">pub fn <ahref="#method.windows"class="fn">windows</a>(&self, size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.Windows.html"title="struct core::slice::iter::Windows">Windows</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over all contiguous windows of length
use <ahref="https://doc.rust-lang.org/1.77.2/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
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunks"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1123">source</a></span><h4class="code-header">pub fn <ahref="#method.chunks"class="fn">chunks</a>(&self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.Chunks.html"title="struct core::slice::iter::Chunks">Chunks</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
<p>See <ahref="https://doc.rust-lang.org/1.77.2/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
<code>chunk_size</code> elements, and <ahref="https://doc.rust-lang.org/1.77.2/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
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunks_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1162">source</a></span><h4class="code-header">pub fn <ahref="#method.chunks_mut"class="fn">chunks_mut</a>(&mut self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ChunksMut.html"title="struct core::slice::iter::ChunksMut">ChunksMut</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
<p>See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_exact_mut"title="method slice::chunks_exact_mut"><code>chunks_exact_mut</code></a> for a variant of this iterator that returns chunks of always
exactly <code>chunk_size</code> elements, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.rchunks_mut"title="method slice::rchunks_mut"><code>rchunks_mut</code></a> for the same iterator but starting at
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunks_exact"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.31.0">1.31.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1200">source</a></span><h4class="code-header">pub fn <ahref="#method.chunks_exact"class="fn">chunks_exact</a>(&self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ChunksExact.html"title="struct core::slice::iter::ChunksExact">ChunksExact</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
resulting code better than in the case of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks"title="method slice::chunks"><code>chunks</code></a>.</p>
<p>See <ahref="https://doc.rust-lang.org/1.77.2/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
chunk, and <ahref="https://doc.rust-lang.org/1.77.2/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>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunks_exact_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.31.0">1.31.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1243">source</a></span><h4class="code-header">pub fn <ahref="#method.chunks_exact_mut"class="fn">chunks_exact_mut</a>(&mut self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ChunksExactMut.html"title="struct core::slice::iter::ChunksExactMut">ChunksExactMut</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
resulting code better than in the case of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_mut"title="method slice::chunks_mut"><code>chunks_mut</code></a>.</p>
<p>See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_mut"title="method slice::chunks_mut"><code>chunks_mut</code></a> for a variant of this iterator that also returns the remainder as a
smaller chunk, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.rchunks_exact_mut"title="method slice::rchunks_exact_mut"><code>rchunks_exact_mut</code></a> for the same iterator but starting at the end of
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_chunks_unchecked"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1278">source</a><h4class="code-header">pub unsafe fn <ahref="#method.as_chunks_unchecked"class="fn">as_chunks_unchecked</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>]</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_chunks"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1323">source</a><h4class="code-header">pub fn <ahref="#method.as_chunks"class="fn">as_chunks</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -> (&[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>], &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_rchunks"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1355">source</a><h4class="code-header">pub fn <ahref="#method.as_rchunks"class="fn">as_rchunks</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -> (&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>])</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.array_chunks"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1395">source</a><h4class="code-header">pub fn <ahref="#method.array_chunks"class="fn">array_chunks</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ArrayChunks.html"title="struct core::slice::iter::ArrayChunks">ArrayChunks</a><'_, T, N></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>array_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Returns an iterator over <code>N</code> elements of the slice at a time, starting at the
<p>This method is the const generic equivalent of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_exact"title="method slice::chunks_exact"><code>chunks_exact</code></a>.</p>
) ->&mut [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>]</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_chunks_mut"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1472">source</a><h4class="code-header">pub fn <ahref="#method.as_chunks_mut"class="fn">as_chunks_mut</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&mut self) -> (&mut [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>], &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_rchunks_mut"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1510">source</a><h4class="code-header">pub fn <ahref="#method.as_rchunks_mut"class="fn">as_rchunks_mut</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&mut self) -> (&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &mut [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">[T; N]</a>])</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_as_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice into a slice of <code>N</code>-element arrays,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.array_chunks_mut"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1552">source</a><h4class="code-header">pub fn <ahref="#method.array_chunks_mut"class="fn">array_chunks_mut</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&mut self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ArrayChunksMut.html"title="struct core::slice::iter::ArrayChunksMut">ArrayChunksMut</a><'_, T, N></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>array_chunks</code>)</span></div></span></summary><divclass="docblock"><p>Returns an iterator over <code>N</code> elements of the slice at a time, starting at the
<p>This method is the const generic equivalent of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_exact_mut"title="method slice::chunks_exact_mut"><code>chunks_exact_mut</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.array_windows"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1585">source</a><h4class="code-header">pub fn <ahref="#method.array_windows"class="fn">array_windows</a><const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ArrayWindows.html"title="struct core::slice::iter::ArrayWindows">ArrayWindows</a><'_, T, N></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>array_windows</code>)</span></div></span></summary><divclass="docblock"><p>Returns an iterator over overlapping windows of <code>N</code> elements of a slice,
<p>This is the const generic equivalent of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.windows"title="method slice::windows"><code>windows</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rchunks"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.31.0">1.31.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1620">source</a></span><h4class="code-header">pub fn <ahref="#method.rchunks"class="fn">rchunks</a>(&self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RChunks.html"title="struct core::slice::iter::RChunks">RChunks</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the end
<p>See <ahref="https://doc.rust-lang.org/1.77.2/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
<code>chunk_size</code> elements, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks"title="method slice::chunks"><code>chunks</code></a> for the same iterator but starting at the beginning
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rchunks_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.31.0">1.31.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1659">source</a></span><h4class="code-header">pub fn <ahref="#method.rchunks_mut"class="fn">rchunks_mut</a>(&mut self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RChunksMut.html"title="struct core::slice::iter::RChunksMut">RChunksMut</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the end
<p>See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.rchunks_exact_mut"title="method slice::rchunks_exact_mut"><code>rchunks_exact_mut</code></a> for a variant of this iterator that returns chunks of always
exactly <code>chunk_size</code> elements, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_mut"title="method slice::chunks_mut"><code>chunks_mut</code></a> for the same iterator but starting at the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rchunks_exact"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.31.0">1.31.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1699">source</a></span><h4class="code-header">pub fn <ahref="#method.rchunks_exact"class="fn">rchunks_exact</a>(&self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RChunksExact.html"title="struct core::slice::iter::RChunksExact">RChunksExact</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the
resulting code better than in the case of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.rchunks"title="method slice::rchunks"><code>rchunks</code></a>.</p>
<p>See <ahref="https://doc.rust-lang.org/1.77.2/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
chunk, and <ahref="https://doc.rust-lang.org/1.77.2/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
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rchunks_exact_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.31.0">1.31.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1743">source</a></span><h4class="code-header">pub fn <ahref="#method.rchunks_exact_mut"class="fn">rchunks_exact_mut</a>(&mut self, chunk_size: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RChunksExactMut.html"title="struct core::slice::iter::RChunksExactMut">RChunksExactMut</a><'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time, starting at the end
resulting code better than in the case of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_mut"title="method slice::chunks_mut"><code>chunks_mut</code></a>.</p>
<p>See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.rchunks_mut"title="method slice::rchunks_mut"><code>rchunks_mut</code></a> for a variant of this iterator that also returns the remainder as a
smaller chunk, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.chunks_exact_mut"title="method slice::chunks_exact_mut"><code>chunks_exact_mut</code></a> for the same iterator but starting at the beginning
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunk_by"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1782-1784">source</a></span><h4class="code-header">pub fn <ahref="#method.chunk_by"class="fn">chunk_by</a><F>(&self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ChunkBy.html"title="struct core::slice::iter::ChunkBy">ChunkBy</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over the slice producing non-overlapping runs
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunk_by_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.77.0">1.77.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1823-1825">source</a></span><h4class="code-header">pub fn <ahref="#method.chunk_by_mut"class="fn">chunk_by_mut</a><F>(&mut self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.ChunkByMut.html"title="struct core::slice::iter::ChunkByMut">ChunkByMut</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over the slice producing non-overlapping mutable
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1870">source</a></span><h4class="code-header">pub fn <ahref="#method.split_at"class="fn">split_at</a>(&self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -> (&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section></summary><divclass="docblock"><p>Divides one slice into two at an index.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1904">source</a></span><h4class="code-header">pub fn <ahref="#method.split_at_mut"class="fn">split_at_mut</a>(&mut self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -> (&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section></summary><divclass="docblock"><p>Divides one mutable slice into two at an index.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at_unchecked"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#1960">source</a><h4class="code-header">pub unsafe fn <ahref="#method.split_at_unchecked"class="fn">split_at_unchecked</a>(&self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -> (&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_split_at_unchecked</code>)</span></div></span></summary><divclass="docblock"><p>Divides one slice into two at an index, without doing bounds checking.</p>
<p>For a safe alternative see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.split_at"title="method slice::split_at"><code>split_at</code></a>.</p>
<p>Calling this method with an out-of-bounds index is <em><ahref="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>
even if the resulting reference is not used. The caller has to ensure that
) -> (&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_split_at_unchecked</code>)</span></div></span></summary><divclass="docblock"><p>Divides one mutable slice into two at an index, without doing bounds checking.</p>
<p>For a safe alternative see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.split_at_mut"title="method slice::split_at_mut"><code>split_at_mut</code></a>.</p>
<p>Calling this method with an out-of-bounds index is <em><ahref="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>
even if the resulting reference is not used. The caller has to ensure that
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at_checked"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2071">source</a><h4class="code-header">pub fn <ahref="#method.split_at_checked"class="fn">split_at_checked</a>(&self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>split_at_checked</code>)</span></div></span></summary><divclass="docblock"><p>Divides one slice into two at an index, returning <code>None</code> if the slice is
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>split_at_checked</code>)</span></div></span></summary><divclass="docblock"><p>Divides one mutable slice into two at an index, returning <code>None</code> if the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2164-2166">source</a></span><h4class="code-header">pub fn <ahref="#method.split"class="fn">split</a><F>(&self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.Split.html"title="struct core::slice::iter::Split">Split</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2186-2188">source</a></span><h4class="code-header">pub fn <ahref="#method.split_mut"class="fn">split_mut</a><F>(&mut self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.SplitMut.html"title="struct core::slice::iter::SplitMut">SplitMut</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_inclusive"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.51.0">1.51.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2222-2224">source</a></span><h4class="code-header">pub fn <ahref="#method.split_inclusive"class="fn">split_inclusive</a><F>(&self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.SplitInclusive.html"title="struct core::slice::iter::SplitInclusive">SplitInclusive</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_inclusive_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.51.0">1.51.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2246-2248">source</a></span><h4class="code-header">pub fn <ahref="#method.split_inclusive_mut"class="fn">split_inclusive_mut</a><F>(&mut self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.SplitInclusiveMut.html"title="struct core::slice::iter::SplitInclusiveMut">SplitInclusiveMut</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.27.0">1.27.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2282-2284">source</a></span><h4class="code-header">pub fn <ahref="#method.rsplit"class="fn">rsplit</a><F>(&self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RSplit.html"title="struct core::slice::iter::RSplit">RSplit</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.27.0">1.27.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2308-2310">source</a></span><h4class="code-header">pub fn <ahref="#method.rsplit_mut"class="fn">rsplit_mut</a><F>(&mut self, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RSplitMut.html"title="struct core::slice::iter::RSplitMut">RSplitMut</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.splitn"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2336-2338">source</a></span><h4class="code-header">pub fn <ahref="#method.splitn"class="fn">splitn</a><F>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.SplitN.html"title="struct core::slice::iter::SplitN">SplitN</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.splitn_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2362-2364">source</a></span><h4class="code-header">pub fn <ahref="#method.splitn_mut"class="fn">splitn_mut</a><F>(&mut self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.SplitNMut.html"title="struct core::slice::iter::SplitNMut">SplitNMut</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that match
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplitn"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2391-2393">source</a></span><h4class="code-header">pub fn <ahref="#method.rsplitn"class="fn">rsplitn</a><F>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RSplitN.html"title="struct core::slice::iter::RSplitN">RSplitN</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplitn_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2418-2420">source</a></span><h4class="code-header">pub fn <ahref="#method.rsplitn_mut"class="fn">rsplitn_mut</a><F>(&mut self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, pred: F) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/iter/struct.RSplitNMut.html"title="struct core::slice::iter::RSplitNMut">RSplitNMut</a><'_, T, F><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_split_once</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice on the first element that matches the specified
<spanclass="macro">assert_eq!</span>(s.split_once(|<spanclass="kw-2">&</span>x| x == <spanclass="number">2</span>), <spanclass="prelude-val">Some</span>((
<spanclass="macro">assert_eq!</span>(s.split_once(|<spanclass="kw-2">&</span>x| x == <spanclass="number">0</span>), <spanclass="prelude-val">None</span>);</code></pre></div>
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_split_once</code>)</span></div></span></summary><divclass="docblock"><p>Splits the slice on the last element that matches the specified
<spanclass="macro">assert_eq!</span>(s.rsplit_once(|<spanclass="kw-2">&</span>x| x == <spanclass="number">2</span>), <spanclass="prelude-val">Some</span>((
<spanclass="macro">assert_eq!</span>(s.rsplit_once(|<spanclass="kw-2">&</span>x| x == <spanclass="number">0</span>), <spanclass="prelude-val">None</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.contains"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2509-2511">source</a></span><h4class="code-header">pub fn <ahref="#method.contains"class="fn">contains</a>(&self, x: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a><divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if the slice contains an element with the given value.</p>
<p>Note that if you have a sorted slice, <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search"title="method slice::binary_search"><code>binary_search</code></a> may be faster.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.starts_with"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2538-2540">source</a></span><h4class="code-header">pub fn <ahref="#method.starts_with"class="fn">starts_with</a>(&self, needle: &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a><divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if <code>needle</code> is a prefix of the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ends_with"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2568-2570">source</a></span><h4class="code-header">pub fn <ahref="#method.ends_with"class="fn">ends_with</a>(&self, needle: &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a><divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if <code>needle</code> is a suffix of the slice.</p>
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><divclass="docblock"><p>Returns a subslice with the prefix removed.</p>
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section></summary><divclass="docblock"><p>Returns a subslice with the suffix removed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.binary_search"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2716-2718">source</a></span><h4class="code-header">pub fn <ahref="#method.binary_search"class="fn">binary_search</a>(&self, x: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>><divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Binary searches this slice for a given element.
<p>If the value is found then <ahref="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html#variant.Ok"title="variant core::result::Result::Ok"><code>Result::Ok</code></a> is returned, containing the
If the value is not found then <ahref="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html#variant.Err"title="variant core::result::Result::Err"><code>Result::Err</code></a> is returned, containing
<p>See also <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search_by"title="method slice::binary_search_by"><code>binary_search_by</code></a>, <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search_by_key"title="method slice::binary_search_by_key"><code>binary_search_by_key</code></a>, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.partition_point"title="method slice::partition_point"><code>partition_point</code></a>.</p>
an arbitrary matching one, that can be done using <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.partition_point"title="method slice::partition_point"><code>partition_point</code></a>:</p>
<spanclass="macro">assert!</span>(s[..low].iter().all(|<spanclass="kw-2">&</span>x| x <<spanclass="number">1</span>));
<spanclass="macro">assert!</span>(s[low..high].iter().all(|<spanclass="kw-2">&</span>x| x == <spanclass="number">1</span>));
<spanclass="macro">assert!</span>(s[high..].iter().all(|<spanclass="kw-2">&</span>x| x ><spanclass="number">1</span>));
<spanclass="comment">// For something not found, the "range" of equal items is empty
</span><spanclass="macro">assert_eq!</span>(s.partition_point(|x| x <<spanclass="kw-2">&</span><spanclass="number">11</span>), <spanclass="number">9</span>);
<spanclass="macro">assert_eq!</span>(s.partition_point(|x| x <= <spanclass="kw-2">&</span><spanclass="number">11</span>), <spanclass="number">9</span>);
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.binary_search_by"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2767-2769">source</a></span><h4class="code-header">pub fn <ahref="#method.binary_search_by"class="fn">binary_search_by</a><'a, F>(&'a self, f: F) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a T</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Binary searches this slice with a comparator function.</p>
<p>If the value is found then <ahref="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html#variant.Ok"title="variant core::result::Result::Ok"><code>Result::Ok</code></a> is returned, containing the
If the value is not found then <ahref="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html#variant.Err"title="variant core::result::Result::Err"><code>Result::Err</code></a> is returned, containing
<p>See also <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search"title="method slice::binary_search"><code>binary_search</code></a>, <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search_by_key"title="method slice::binary_search_by_key"><code>binary_search_by_key</code></a>, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.partition_point"title="method slice::partition_point"><code>partition_point</code></a>.</p>
B: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Binary searches this slice with a key extraction function.</p>
<ahref="https://doc.rust-lang.org/1.77.2/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.
<p>If the value is found then <ahref="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html#variant.Ok"title="variant core::result::Result::Ok"><code>Result::Ok</code></a> is returned, containing the
If the value is not found then <ahref="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html#variant.Err"title="variant core::result::Result::Err"><code>Result::Err</code></a> is returned, containing
<p>See also <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search"title="method slice::binary_search"><code>binary_search</code></a>, <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search_by"title="method slice::binary_search_by"><code>binary_search_by</code></a>, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.partition_point"title="method slice::partition_point"><code>partition_point</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_unstable"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2891-2893">source</a></span><h4class="code-header">pub fn <ahref="#method.sort_unstable"class="fn">sort_unstable</a>(&mut self)<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice, but might not preserve the order of equal elements.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_unstable_by"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#2946-2948">source</a></span><h4class="code-header">pub fn <ahref="#method.sort_unstable_by"class="fn">sort_unstable_by</a><F>(&mut self, compare: F)<divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice with a comparator function, but might not preserve the order of equal
<p>This sort is unstable (i.e., may reorder equal elements), in-place
(i.e., does not allocate), and <em>O</em>(<em>n</em> * log(<em>n</em>)) worst-case.</p>
<p>The comparator function must define a total ordering for the elements in the slice. If
the ordering is not total, the order of the elements is unspecified. An order is a
total order if it is (for all <code>a</code>, <code>b</code> and <code>c</code>):</p>
<ul>
<li>total and antisymmetric: exactly one of <code>a < b</code>, <code>a == b</code> or <code>a > b</code> is true, and</li>
<li>transitive, <code>a < b</code> and <code>b < c</code> implies <code>a < c</code>. The same must hold for both <code>==</code> and <code>></code>.</li>
<p>For example, while <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.f64.html"title="primitive f64"><code>f64</code></a> doesn’t implement <ahref="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord"><code>Ord</code></a> because <code>NaN != NaN</code>, we can use
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice with a key extraction function, but might not preserve the order of equal
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.select_nth_unstable"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.49.0">1.49.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3034-3036">source</a></span><h4class="code-header">pub fn <ahref="#method.select_nth_unstable"class="fn">select_nth_unstable</a>(
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Reorder the slice such that the element at <code>index</code> is at its final sorted position.</p>
the basis for <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable"title="method slice::sort_unstable"><code>sort_unstable</code></a>. The fallback algorithm is Median of Medians using Tukey’s Ninther for
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.select_nth_unstable_by"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.49.0">1.49.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3085-3091">source</a></span><h4class="code-header">pub fn <ahref="#method.select_nth_unstable_by"class="fn">select_nth_unstable_by</a><F>(
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Reorder the slice with a comparator function such that the element at <code>index</code> is at its
the basis for <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable"title="method slice::sort_unstable"><code>sort_unstable</code></a>. The fallback algorithm is Median of Medians using Tukey’s Ninther for
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Reorder the slice with a key extraction function such that the element at <code>index</code> is at its
the basis for <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable"title="method slice::sort_unstable"><code>sort_unstable</code></a>. The fallback algorithm is Median of Medians using Tukey’s Ninther for
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_partition_dedup</code>)</span></div></span></summary><divclass="docblock"><p>Moves all consecutive repeated elements to the end of the slice according to the
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_partition_dedup</code>)</span></div></span></summary><divclass="docblock"><p>Moves all but the first of consecutive elements to the end of the slice satisfying
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_partition_dedup</code>)</span></div></span></summary><divclass="docblock"><p>Moves all but the first of consecutive elements to the end of the slice that resolve
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rotate_left"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.26.0">1.26.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3373">source</a></span><h4class="code-header">pub fn <ahref="#method.rotate_left"class="fn">rotate_left</a>(&mut self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Rotates the slice in-place such that the first <code>mid</code> elements of the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rotate_right"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.26.0">1.26.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3416">source</a></span><h4class="code-header">pub fn <ahref="#method.rotate_right"class="fn">rotate_right</a>(&mut self, k: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Rotates the slice in-place such that the first <code>self.len() - k</code>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.fill"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.50.0">1.50.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3439-3441">source</a></span><h4class="code-header">pub fn <ahref="#method.fill"class="fn">fill</a>(&mut self, value: T)<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><divclass="docblock"><p>Fills <code>self</code> with elements by cloning <code>value</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.fill_with"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.51.0">1.51.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3463-3465">source</a></span><h4class="code-header">pub fn <ahref="#method.fill_with"class="fn">fill_with</a><F>(&mut self, f: F)<divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>() -> T,</div></h4></section></summary><divclass="docblock"><p>Fills <code>self</code> with elements returned by calling a closure repeatedly.</p>
<ahref="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html"title="trait core::clone::Clone"><code>Clone</code></a> a given value, use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.fill"title="method slice::fill"><code>fill</code></a>. If you want to use the <ahref="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html"title="trait core::default::Default"><code>Default</code></a>
trait to generate values, you can pass <ahref="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html#tymethod.default"title="associated function core::default::Default::default"><code>Default::default</code></a> as the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_from_slice"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.7.0">1.7.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3526-3528">source</a></span><h4class="code-header">pub fn <ahref="#method.clone_from_slice"class="fn">clone_from_slice</a>(&mut self, src: &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><divclass="docblock"><p>Copies the elements from <code>src</code> into <code>self</code>.</p>
<p>To work around this, we can use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.split_at_mut"title="method slice::split_at_mut"><code>split_at_mut</code></a> to create two distinct
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.copy_from_slice"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.9.0">1.9.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3590-3592">source</a></span><h4class="code-header">pub fn <ahref="#method.copy_from_slice"class="fn">copy_from_slice</a>(&mut self, src: &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a>,</div></h4></section></summary><divclass="docblock"><p>Copies all elements from <code>src</code> into <code>self</code>, using a memcpy.</p>
<p>If <code>T</code> does not implement <code>Copy</code>, use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.clone_from_slice"title="method slice::clone_from_slice"><code>clone_from_slice</code></a>.</p>
<p>To work around this, we can use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.split_at_mut"title="method slice::split_at_mut"><code>split_at_mut</code></a> to create two distinct
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a>,</div></h4></section></summary><divclass="docblock"><p>Copies elements from one part of the slice to another part of itself,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_with_slice"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.27.0">1.27.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3711">source</a></span><h4class="code-header">pub fn <ahref="#method.swap_with_slice"class="fn">swap_with_slice</a>(&mut self, other: &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section></summary><divclass="docblock"><p>Swaps all elements in <code>self</code> with those in <code>other</code>.</p>
<p>To work around this, we can use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.split_at_mut"title="method slice::split_at_mut"><code>split_at_mut</code></a> to create two distinct
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.align_to"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3791">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.align_to"class="fn">align_to</a><U>(&self) -> (&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[U]</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section></summary><divclass="docblock"><p>Transmute the slice to a slice of another type, ensuring alignment of the types is
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.align_to_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#3859">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.align_to_mut"class="fn">align_to_mut</a><U>(&mut self) -> (&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[U]</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>)</h4></section></summary><divclass="docblock"><p>Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the
<aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/core_simd/lane_count/struct.LaneCount.html"title="struct core::core_simd::lane_count::LaneCount">LaneCount</a><LANES>: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/core_simd/lane_count/trait.SupportedLaneCount.html"title="trait core::core_simd::lane_count::SupportedLaneCount">SupportedLaneCount</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>portable_simd</code>)</span></div></span></summary><divclass="docblock"><p>Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.</p>
<p>This is a safe wrapper around <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.align_to"title="method slice::align_to"><code>slice::align_to</code></a>, so has the same weak
<aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/core_simd/lane_count/struct.LaneCount.html"title="struct core::core_simd::lane_count::LaneCount">LaneCount</a><LANES>: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/core_simd/lane_count/trait.SupportedLaneCount.html"title="trait core::core_simd::lane_count::SupportedLaneCount">SupportedLaneCount</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>portable_simd</code>)</span></div></span></summary><divclass="docblock"><p>Split a mutable slice into a mutable prefix, a middle of aligned SIMD types,
<p>This is a safe wrapper around <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.align_to_mut"title="method slice::align_to_mut"><code>slice::align_to_mut</code></a>, so has the same weak
<p>This is the mutable version of <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.as_simd"title="method slice::as_simd"><code>slice::as_simd</code></a>; see that for examples.</p>
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialOrd.html"title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>is_sorted</code>)</span></div></span></summary><divclass="docblock"><p>Checks if the elements of this slice are sorted.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>is_sorted</code>)</span></div></span></summary><divclass="docblock"><p>Checks if the elements of this slice are sorted using the given comparator function.</p>
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialOrd.html"title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>is_sorted</code>)</span></div></span></summary><divclass="docblock"><p>Checks if the elements of this slice are sorted using the given key extraction function.</p>
elements, as determined by <code>f</code>. Apart from that, it’s equivalent to <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.is_sorted"title="method slice::is_sorted"><code>is_sorted</code></a>; see its
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.partition_point"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.52.0">1.52.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4158-4160">source</a></span><h4class="code-header">pub fn <ahref="#method.partition_point"class="fn">partition_point</a><P>(&self, pred: P) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns the index of the partition point according to the given predicate
<p>See also <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search"title="method slice::binary_search"><code>binary_search</code></a>, <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search_by"title="method slice::binary_search_by"><code>binary_search_by</code></a>, and <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.binary_search_by_key"title="method slice::binary_search_by_key"><code>binary_search_by_key</code></a>.</p>
<spanclass="macro">assert_eq!</span>(a.partition_point(|x| x <<spanclass="kw-2">&</span><spanclass="number">100</span>), <spanclass="number">0</span>);</code></pre></div>
<p>If you want to insert an item to a sorted vector, while maintaining
R: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/range/trait.OneSidedRange.html"title="trait core::ops::range::OneSidedRange">OneSidedRange</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_take</code>)</span></div></span></summary><divclass="docblock"><p>Removes the subslice corresponding to the given range
R: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/range/trait.OneSidedRange.html"title="trait core::ops::range::OneSidedRange">OneSidedRange</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_take</code>)</span></div></span></summary><divclass="docblock"><p>Removes the subslice corresponding to the given range
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_first"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4324">source</a><h4class="code-header">pub fn <ahref="#method.take_first"class="fn">take_first</a><'a>(self: &mut &'a <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a T</a>></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_take</code>)</span></div></span></summary><divclass="docblock"><p>Removes the first element of the slice and returns a reference
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_first_mut"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4349">source</a><h4class="code-header">pub fn <ahref="#method.take_first_mut"class="fn">take_first_mut</a><'a>(self: &mut &'a mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a mut T</a>></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_take</code>)</span></div></span></summary><divclass="docblock"><p>Removes the first element of the slice and returns a mutable
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_last"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4373">source</a><h4class="code-header">pub fn <ahref="#method.take_last"class="fn">take_last</a><'a>(self: &mut &'a <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a T</a>></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_take</code>)</span></div></span></summary><divclass="docblock"><p>Removes the last element of the slice and returns a reference
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_last_mut"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4398">source</a><h4class="code-header">pub fn <ahref="#method.take_last_mut"class="fn">take_last_mut</a><'a>(self: &mut &'a mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&'a mut T</a>></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_take</code>)</span></div></span></summary><divclass="docblock"><p>Removes the last element of the slice and returns a mutable
) -> [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>; <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">N</a>]</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>get_many_mut</code>)</span></div></span></summary><divclass="docblock"><p>Returns mutable references to many indices at once, without doing any checks.</p>
<p>For a safe alternative see <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.get_many_mut"title="method slice::get_many_mut"><code>get_many_mut</code></a>.</p>
<p>Calling this method with overlapping or out-of-bounds indices is <em><ahref="https://doc.rust-lang.org/reference/behavior-considered-undefined.html">undefined behavior</a></em>
even if the resulting references are not used.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a>; <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.array.html">N</a>], <aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/struct.GetManyMutError.html"title="struct core::slice::GetManyMutError">GetManyMutError</a><N>></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>get_many_mut</code>)</span></div></span></summary><divclass="docblock"><p>Returns mutable references to many indices at once.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_floats-1"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4592">source</a><h4class="code-header">pub fn <ahref="#method.sort_floats-1"class="fn">sort_floats</a>(&mut self)</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>sort_floats</code>)</span></div></span></summary><divclass="docblock"><p>Sorts the slice of floats.</p>
<p>This sort is in-place (i.e. does not allocate), <em>O</em>(<em>n</em> * log(<em>n</em>)) worst-case, and uses
the ordering defined by <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.f32.html#method.total_cmp"title="method f32::total_cmp"><code>f32::total_cmp</code></a>.</p>
<p>This uses the same sorting algorithm as <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable_by"title="method slice::sort_unstable_by"><code>sort_unstable_by</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.flatten"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4517">source</a><h4class="code-header">pub fn <ahref="#method.flatten"class="fn">flatten</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_flatten</code>)</span></div></span></summary><divclass="docblock"><p>Takes a <code>&[[T; N]]</code>, and flattens it to a <code>&[T]</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.flatten_mut"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/mod.rs.html#4555">source</a><h4class="code-header">pub fn <ahref="#method.flatten_mut"class="fn">flatten_mut</a>(&mut self) ->&mut <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_flatten</code>)</span></div></span></summary><divclass="docblock"><p>Takes a <code>&mut [[T; N]]</code>, and flattens it to a <code>&mut [T]</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_str-1"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/ascii/ascii_char.rs.html#560">source</a><h4class="code-header">pub fn <ahref="#method.as_str-1"class="fn">as_str</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><divclass="docblock"><p>Views this slice of ASCII characters as a UTF-8 <code>str</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_bytes"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/ascii/ascii_char.rs.html#571">source</a><h4class="code-header">pub fn <ahref="#method.as_bytes"class="fn">as_bytes</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><divclass="docblock"><p>Views this slice of ASCII characters as a slice of <code>u8</code> bytes.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_ascii"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#17">source</a></span><h4class="code-header">pub fn <ahref="#method.is_ascii"class="fn">is_ascii</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks if all bytes in this slice are within the ASCII range.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ascii"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#26">source</a><h4class="code-header">pub fn <ahref="#method.as_ascii"class="fn">as_ascii</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&[<aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/ascii/ascii_char/enum.AsciiChar.html"title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><divclass="docblock"><p>If this slice <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.is_ascii"title="method slice::is_ascii"><code>is_ascii</code></a>, returns it as a slice of
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ascii_unchecked"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#44">source</a><h4class="code-header">pub unsafe fn <ahref="#method.as_ascii_unchecked"class="fn">as_ascii_unchecked</a>(&self) ->&[<aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/ascii/ascii_char/enum.AsciiChar.html"title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><divclass="docblock"><p>Converts this slice of bytes into a slice of ASCII characters,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq_ignore_ascii_case"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#58">source</a></span><h4class="code-header">pub fn <ahref="#method.eq_ignore_ascii_case"class="fn">eq_ignore_ascii_case</a>(&self, other: &[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>]) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks that two slices are an ASCII case-insensitive match.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_ascii_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#73">source</a></span><h4class="code-header">pub fn <ahref="#method.make_ascii_uppercase"class="fn">make_ascii_uppercase</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Converts this slice to its ASCII upper case equivalent in-place.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_ascii_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#90">source</a></span><h4class="code-header">pub fn <ahref="#method.make_ascii_lowercase"class="fn">make_ascii_lowercase</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Converts this slice to its ASCII lower case equivalent in-place.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_ascii"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.60.0">1.60.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#110">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_ascii"class="fn">escape_ascii</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/slice/ascii/struct.EscapeAscii.html"title="struct core::slice::ascii::EscapeAscii">EscapeAscii</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator that produces an escaped version of this slice,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_ascii_start"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#130">source</a><h4class="code-header">pub fn <ahref="#method.trim_ascii_start"class="fn">trim_ascii_start</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>byte_slice_trim_ascii</code>)</span></div></span></summary><divclass="docblock"><p>Returns a byte slice with leading ASCII whitespace bytes removed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_ascii"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/slice/ascii.rs.html#191">source</a><h4class="code-header">pub fn <ahref="#method.trim_ascii"class="fn">trim_ascii</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>byte_slice_trim_ascii</code>)</span></div></span></summary><divclass="docblock"><p>Returns a byte slice with leading and trailing ASCII whitespace bytes
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#207-209">source</a></span><h4class="code-header">pub fn <ahref="#method.sort"class="fn">sort</a>(&mut self)<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice.</p>
See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable"title="method slice::sort_unstable"><code>sort_unstable</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_by"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#263-265">source</a></span><h4class="code-header">pub fn <ahref="#method.sort_by"class="fn">sort_by</a><F>(&mut self, compare: F)<divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice with a comparator function.</p>
<p>This sort is stable (i.e., does not reorder equal elements) and <em>O</em>(<em>n</em> * log(<em>n</em>)) worst-case.</p>
<p>The comparator function must define a total ordering for the elements in the slice. If
the ordering is not total, the order of the elements is unspecified. An order is a
total order if it is (for all <code>a</code>, <code>b</code> and <code>c</code>):</p>
<ul>
<li>total and antisymmetric: exactly one of <code>a < b</code>, <code>a == b</code> or <code>a > b</code> is true, and</li>
<li>transitive, <code>a < b</code> and <code>b < c</code> implies <code>a < c</code>. The same must hold for both <code>==</code> and <code>></code>.</li>
<p>For example, while <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.f64.html"title="primitive f64"><code>f64</code></a> doesn’t implement <ahref="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord"><code>Ord</code></a> because <code>NaN != NaN</code>, we can use
See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable_by"title="method slice::sort_unstable_by"><code>sort_unstable_by</code></a>.</p>
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice with a key extraction function.</p>
basic operations), <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_by_cached_key"title="method slice::sort_by_cached_key"><code>sort_by_cached_key</code></a> is likely to be
See <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_unstable_by_key"title="method slice::sort_unstable_by_key"><code>sort_unstable_by_key</code></a>.</p>
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sorts the slice with a key extraction function.</p>
basic operations), <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.sort_by_key"title="method slice::sort_by_key"><code>sort_by_key</code></a> is likely to be
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_vec"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#412-414">source</a></span><h4class="code-header">pub fn <ahref="#method.to_vec"class="fn">to_vec</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><T><divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><divclass="docblock"><p>Copies <code>self</code> into a new <code>Vec</code>.</p>
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><divclass="docblock"><p>Copies <code>self</code> into a new <code>Vec</code> with an allocator.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.repeat"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.40.0">1.40.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#489-491">source</a></span><h4class="code-header">pub fn <ahref="#method.repeat"class="fn">repeat</a>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><T><divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a>,</div></h4></section></summary><divclass="docblock"><p>Creates a vector by copying a slice <code>n</code> times.</p>
<divclass="example-wrap should_panic"><ahref="#"class="tooltip"title="This example panics">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="comment">// this will panic at runtime
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.concat"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#557-559">source</a></span><h4class="code-header">pub fn <ahref="#method.concat"class="fn">concat</a><Item>(&self) -><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a> as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Concat.html"title="trait alloc::slice::Concat">Concat</a><Item>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Concat.html#associatedtype.Output"title="type alloc::slice::Concat::Output">Output</a><ahref="#"class="tooltip"data-notable-ty="<[T] as Concat<Item>>::Output">ⓘ</a><divclass="where">where
Item: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass="docblock"><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.join"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.3.0">1.3.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#576-578">source</a></span><h4class="code-header">pub fn <ahref="#method.join"class="fn">join</a><Separator>(
) -><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a> as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Join.html"title="trait alloc::slice::Join">Join</a><Separator>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Join.html#associatedtype.Output"title="type alloc::slice::Join::Output">Output</a><ahref="#"class="tooltip"data-notable-ty="<[T] as Join<Separator>>::Output">ⓘ</a><divclass="where">where
<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Join.html"title="trait alloc::slice::Join">Join</a><Separator>,</div></h4></section></summary><divclass="docblock"><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>, placing a
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.connect"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#596-598">source</a></span><h4class="code-header">pub fn <ahref="#method.connect"class="fn">connect</a><Separator>(
) -><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a> as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Join.html"title="trait alloc::slice::Join">Join</a><Separator>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Join.html#associatedtype.Output"title="type alloc::slice::Join::Output">Output</a><ahref="#"class="tooltip"data-notable-ty="<[T] as Join<Separator>>::Output">ⓘ</a><divclass="where">where
<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html">[T]</a>: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/alloc/slice/trait.Join.html"title="trait alloc::slice::Join">Join</a><Separator>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.3.0: renamed to join</span></div></span></summary><divclass="docblock"><p>Flattens a slice of <code>T</code> into a single value <code>Self::Output</code>, placing a
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_ascii_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#621">source</a></span><h4class="code-header">pub fn <ahref="#method.to_ascii_uppercase"class="fn">to_ascii_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>></h4></section></summary><divclass="docblock"><p>Returns a vector containing a copy of this slice where each byte
is mapped to its ASCII upper case equivalent.</p>
<p>ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’,
but non-ASCII letters are unchanged.</p>
<p>To uppercase the value in-place, use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.make_ascii_uppercase"title="method slice::make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_ascii_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.2/src/alloc/slice.rs.html#642">source</a></span><h4class="code-header">pub fn <ahref="#method.to_ascii_lowercase"class="fn">to_ascii_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>></h4></section></summary><divclass="docblock"><p>Returns a vector containing a copy of this slice where each byte
is mapped to its ASCII lower case equivalent.</p>
<p>ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’,
but non-ASCII letters are unchanged.</p>
<p>To lowercase the value in-place, use <ahref="https://doc.rust-lang.org/1.77.2/std/primitive.slice.html#method.make_ascii_lowercase"title="method slice::make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
</div></details></div><h2id="trait-implementations"class="section-header">Trait Implementations<ahref="#trait-implementations"class="anchor">§</a></h2><divid="trait-implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Default-for-Buf"class="impl"><aclass="src rightside"href="../src/git2/buf.rs.html#17-21">source</a><ahref="#impl-Default-for-Buf"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html"title="trait core::default::Default">Default</a> for <aclass="struct"href="struct.Buf.html"title="struct git2::Buf">Buf</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.default"class="method trait-impl"><aclass="src rightside"href="../src/git2/buf.rs.html#18-20">source</a><ahref="#method.default"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html#tymethod.default"class="fn">default</a>() -> Self</h4></section></summary><divclass='docblock'>Returns the “default value” for a type. <ahref="https://doc.rust-lang.org/1.77.2/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Deref-for-Buf"class="impl"><aclass="src rightside"href="../src/git2/buf.rs.html#44-49">source</a><ahref="#impl-Deref-for-Buf"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/deref/trait.Deref.html"title="trait core::ops::deref::Deref">Deref</a> for <aclass="struct"href="struct.Buf.html"title="struct git2::Buf">Buf</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Target"class="associatedtype trait-impl"><ahref="#associatedtype.Target"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.2/core/ops/deref/trait.Deref.html#associatedtype.Target"class="associatedtype">Target</a> = [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>]</h4></section></summary><divclass='docblock'>The resulting type after dereferencing.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.deref"class="method trait-impl"><aclass="src rightside"href="../src/git2/buf.rs.html#46-48">source</a><ahref="#method.deref"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/ops/deref/trait.Deref.html#tymethod.deref"class="fn">deref</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><divclass='docblock'>Dereferences the value.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-DerefMut-for-Buf"class="impl"><aclass="src rightside"href="../src/git2/buf.rs.html#51-55">source</a><ahref="#impl-DerefMut-for-Buf"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/ops/deref/trait.DerefMut.html"title="trait core::ops::deref::DerefMut">DerefMut</a> for <aclass="struct"href="struct.Buf.html"title="struct git2::Buf">Buf</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.deref_mut"class="method trait-impl"><aclass="src rightside"href="../src/git2/buf.rs.html#52-54">source</a><ahref="#method.deref_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut"class="fn">deref_mut</a>(&mut self) ->&mut [<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&mut [u8]">
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/any.rs.html#141">source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/1.77.2/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/borrow.rs.html#208">source</a><ahref="#impl-Borrow%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/borrow.rs.html#210">source</a><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.77.2/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/borrow.rs.html#216">source</a><ahref="#impl-BorrowMut%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/borrow.rs.html#217">source</a><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&mut T</a></h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.77.2/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#764">source</a><ahref="#impl-From%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#767">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.From.html#tymethod.from"class="fn">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Into%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#747-749">source</a><ahref="#impl-Into%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T<divclass="where">where
<code><ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#804-806">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#811">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#789-791">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#796">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div><scripttype="text/json"id="notable-traits-data">{"&[u8]":"<h3>Notabletraitsfor<code>&[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><divclass=\"where\">impl<aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.2/std/io/trait.Read.html\"title=\"traitstd::io::Read\">Read</a>for&[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</div>","&mut[u8]":"<h3>Notabletraitsfor<code>&mut[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><divclass=\"where\">impl<aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.2/std/io/trait.Write.html\"title=\"traitstd::io::Write\">Write</a>for&mut[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</div>","<[T]asConcat<Item>>::Output":"<h3>Notabletraitsfor<code>&mut[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><divclass=\"where\">impl<aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.2/std/io/trait.Write.html\"title=\"traitstd::io::Write\">Write</a>for&mut[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</div><divclass=\"where\">impl<aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.2/std/io/trait.Read.html\"title=\"traitstd::io::Read\">Read</a>for&[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</div>","<[T]asJoin<Separator>>::Output":"<h3>Notabletraitsfor<code>&mut[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><divclass=\"where\">impl<aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.2/std/io/trait.Write.html\"title=\"traitstd::io::Write\">Write</a>for&mut[<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.2/std/primitive.u8.html\">u8</a>]</div><divclass=\"where\">impl<aclas