<!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 fixed capacity `Vec`"><title>Vec in heapless - 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/SourceSerif4-Bold-a2c9cd1067f8b328.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-47e7ab555ef2818a.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="heapless"data-themes=""data-resource-suffix=""data-rustdoc-version="1.74.0-nightly (d9c8274fb 2023-09-12)"data-channel="nightly"data-search-js="search-5d3eaacf19ebf04f.js"data-settings-js="settings-74424d7eec62a23e.js"data-settings-css="settings-8c76f75bfb6bd192.css"data-theme-light-css="light-f194925aa375ae96.css"data-theme-dark-css="dark-1dd4d1ce031e15de.css"data-theme-ayu-css="ayu-49e58d069f567085.css"><scriptsrc="../static.files/storage-db41da1a38ea3cb8.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-8d035c8cea6edbc4.js"></script><noscript><linkrel="stylesheet"media="(prefers-color-scheme:light)"href="../static.files/light-f194925aa375ae96.css"><linkrel="stylesheet"media="(prefers-color-scheme:dark)"href="../static.files/dark-1dd4d1ce031e15de.css"><linkrel="stylesheet"href="../static.files/noscript-cffde32267a19fd6.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">☰</button><aclass="logo-container"href="../heapless/index.html"><imgclass="rust-logo"src="../static.files/rust-logo-151179464ae7ed46.svg"alt="logo"></a><h2></h2></nav><navclass="sidebar"><aclass="logo-container"href="../heapless/index.html"><imgclass="rust-logo"src="../static.files/rust-logo-151179464ae7ed46.svg"alt="logo"></a><h2class="location"><ahref="#">Vec</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block"><li><ahref="#method.as_mut_ptr">as_mut_ptr</a></li><li><ahref="#method.as_ptr">as_ptr</a></li><li><ahref="#method.as_slice">as_slice</a></li><li><ahref="#method.capacity">capacity</a></li><li><ahref="#method.clear">clear</a></li><li><ahref="#method.ends_with">ends_with</a></li><li><ahref="#method.extend">extend</a></li><li><ahref="#method.extend_from_slice">extend_from_slice</a></li><li><ahref="#method.from_slice">from_slice</a></li><li><ahref="#method.insert">insert</a></li><li><ahref="#method.into_array">into_array</a></li><li><ahref="#method.is_empty">is_empty</a></li><li><ahref="#method.is_full">is_full</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.pop">pop</a></li><li><ahref="#method.pop_unchecked">pop_unchecked</a></li><li><ahref="#method.push">push</a></li><li><ahref="#method.push_unchecked">push_unchecked</a><
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#111-113">source</a><h4class="code-header">pub fn <ahref="#method.as_ptr"class="fn">as_ptr</a>(&self) -> *const T</h4></section></summary><divclass="docblock"><p>Returns a raw pointer to the vector’s buffer.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_ptr"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#116-118">source</a><h4class="code-header">pub fn <ahref="#method.as_mut_ptr"class="fn">as_mut_ptr</a>(&mut self) -> *mut T</h4></section></summary><divclass="docblock"><p>Returns a raw pointer to the vector’s buffer, which may be mutated through.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_slice"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#131-135">source</a><h4class="code-header">pub fn <ahref="#method.as_slice"class="fn">as_slice</a>(&self) ->&[T]</h4></section></summary><divclass="docblock"><p>Extracts a slice containing the entire vector.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_array"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#148-161">source</a><h4class="code-header">pub fn <ahref="#method.into_array"class="fn">into_array</a><const M: usize>(self) -> Result<[T; M], Self></h4></section></summary><divclass="docblock"><p>Returns the contents of the vector as an array of length <code>M</code> if the length
of the vector is exactly <code>M</code>, otherwise returns <code>Err(self)</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.capacity"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#182-184">source</a><h4class="code-header">pub const fn <ahref="#method.capacity"class="fn">capacity</a>(&self) -> usize</h4></section></summary><divclass="docblock"><p>Returns the maximum number of elements the vector can hold.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clear"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#187-189">source</a><h4class="code-header">pub fn <ahref="#method.clear"class="fn">clear</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Clears the vector, removing all values.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.pop"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#238-244">source</a><h4class="code-header">pub fn <ahref="#method.pop"class="fn">pop</a>(&mut self) -> Option<T></h4></section></summary><divclass="docblock"><p>Removes the last element from a vector and returns it, or <code>None</code> if it’s empty</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.push"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#249-256">source</a><h4class="code-header">pub fn <ahref="#method.push"class="fn">push</a>(&mut self, item: T) -> Result<(), T></h4></section></summary><divclass="docblock"><p>Appends an <code>item</code> to the back of the collection</p>
<p>Returns back the <code>item</code> if the vector is full</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.pop_unchecked"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#263-268">source</a><h4class="code-header">pub unsafe fn <ahref="#method.pop_unchecked"class="fn">pop_unchecked</a>(&mut self) -> T</h4></section></summary><divclass="docblock"><p>Removes the last element from a vector and returns it</p>
<h5id="safety"><ahref="#safety">Safety</a></h5>
<p>This assumes the vec to have at least one element.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.push_unchecked"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#275-283">source</a><h4class="code-header">pub unsafe fn <ahref="#method.push_unchecked"class="fn">push_unchecked</a>(&mut self, item: T)</h4></section></summary><divclass="docblock"><p>Appends an <code>item</code> to the back of the collection</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.truncate"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#286-306">source</a><h4class="code-header">pub fn <ahref="#method.truncate"class="fn">truncate</a>(&mut self, len: usize)</h4></section></summary><divclass="docblock"><p>Shortens the vector, keeping the first <code>len</code> elements and dropping the rest.</p>
T: Clone + Default,</span></h4></section></summary><divclass="docblock"><p>Resizes the <code>Vec</code> in-place so that <code>len</code> is equal to <code>new_len</code>.</p>
<p>If <code>new_len</code> is greater than <code>len</code>, the <code>Vec</code> is extended by the
difference, with each additional slot filled with <code>Default::default()</code>.
If <code>new_len</code> is less than <code>len</code>, the <code>Vec</code> is simply truncated.</p>
<p>See also <ahref="struct.Vec.html#method.resize"><code>resize</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.set_len"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#437-441">source</a><h4class="code-header">pub unsafe fn <ahref="#method.set_len"class="fn">set_len</a>(&mut self, new_len: usize)</h4></section></summary><divclass="docblock"><p>Forces the length of the vector to <code>new_len</code>.</p>
<p>This is a low-level operation that maintains none of the normal
invariants of the type. Normally changing the length of a vector
is done using one of the safe operations instead, such as
<ahref="#method.truncate"><code>truncate</code></a>, <ahref="#method.resize"><code>resize</code></a>, <ahref="https://doc.rust-lang.org/stable/core/iter/trait.Extend.html#tymethod.extend"><code>extend</code></a>, or <ahref="#method.clear"><code>clear</code></a>.</p>
// 1. `old_len..0` is empty so no elements need to be initialized.
// 2. `0 <= capacity` always holds whatever `capacity` is.
</span><spanclass="kw">unsafe </span>{
vec.set_len(<spanclass="number">0</span>);
}</code></pre></div>
<p>Normally, here, one would use <ahref="#method.clear"><code>clear</code></a> instead to correctly drop
the contents and thus not leak memory.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_remove"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#471-474">source</a><h4class="code-header">pub fn <ahref="#method.swap_remove"class="fn">swap_remove</a>(&mut self, index: usize) -> T</h4></section></summary><divclass="docblock"><p>Removes an element from the vector and returns it.</p>
<p>The removed element is replaced by the last element of the vector.</p>
<p>This does not preserve ordering, but is O(1).</p>
<h5id="panics"><ahref="#panics">Panics</a></h5>
<p>Panics if <code>index</code> is out of bounds.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_remove_unchecked"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#503-511">source</a><h4class="code-header">pub unsafe fn <ahref="#method.swap_remove_unchecked"class="fn">swap_remove_unchecked</a>(&mut self, index: usize) -> T</h4></section></summary><divclass="docblock"><p>Removes an element from the vector and returns it.</p>
<p>The removed element is replaced by the last element of the vector.</p>
<p>This does not preserve ordering, but is O(1).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_full"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#515-517">source</a><h4class="code-header">pub fn <ahref="#method.is_full"class="fn">is_full</a>(&self) -> bool</h4></section></summary><divclass="docblock"><p>Returns true if the vec is full</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#521-523">source</a><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -> bool</h4></section></summary><divclass="docblock"><p>Returns true if the vec is empty</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.insert"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#591-621">source</a><h4class="code-header">pub fn <ahref="#method.insert"class="fn">insert</a>(&mut self, index: usize, element: T) -> Result<(), T></h4></section></summary><divclass="docblock"><p>Inserts an element at position <code>index</code> within the vector, shifting all
elements after it to the right.</p>
<p>Returns back the <code>element</code> if the vector is full.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.remove"class="method"><aclass="src rightside"href="../src/heapless/vec.rs.html#648-669">source</a><h4class="code-header">pub fn <ahref="#method.remove"class="fn">remove</a>(&mut self, index: usize) -> T</h4></section></summary><divclass="docblock"><p>Removes and returns the element at position <code>index</code> within the vector,
shifting all elements after it to the left.</p>
<p>Note: Because this shifts over the remaining elements, it has a
worst-case performance of <em>O</em>(<em>n</em>). If you don’t need the order of
elements to be preserved, use <ahref="struct.Vec.html#method.swap_remove"title="method heapless::Vec::swap_remove"><code>swap_remove</code></a> instead. If you’d like to
remove elements from the beginning of the <code>Vec</code>, consider using
F: FnMut(&mut T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Retains only the elements specified by the predicate, passing a mutable reference to it.</p>
<p>In other words, remove all elements <code>e</code> such that <code>f(&mut e)</code> returns <code>false</code>.
This method operates in place, visiting each element exactly once in the
original order, and preserves the order of the retained elements.</p>
</div></details></div></details></div><h2id="deref-methods-%5BT%5D"class="small-section-header"><span>Methods from Deref<Target = [T]></span><ahref="#deref-methods-%5BT%5D"class="anchor">§</a></h2><divid="deref-methods-%5BT%5D-1"class="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.flatten"class="method"><h4class="code-header">pub fn <ahref="#method.flatten"class="fn">flatten</a>(&self) ->&[T]</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"><h4class="code-header">pub fn <ahref="#method.flatten_mut"class="fn">flatten_mut</a>(&mut self) ->&mut [T]</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.is_ascii"class="method"><spanclass="since rightside"title="Stable since Rust version 1.23.0">1.23.0</span><h4class="code-header">pub fn <ahref="#method.is_ascii"class="fn">is_ascii</a>(&self) -> bool</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"><h4class="code-header">pub fn <ahref="#method.as_ascii"class="fn">as_ascii</a>(&self) -> Option<&[AsciiChar]></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="Self::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"><h4class="code-header">pub unsafe fn <ahref="#method.as_ascii_unchecked"class="fn">as_ascii_unchecked</a>(&self) ->&[AsciiChar]</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,
<p>Every byte in the slice must be in <code>0..=127</code>, or else this is UB.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq_ignore_ascii_case"class="method"><spanclass="since rightside"title="Stable since Rust version 1.23.0">1.23.0</span><h4class="code-header">pub fn <ahref="#method.eq_ignore_ascii_case"class="fn">eq_ignore_ascii_case</a>(&self, other: &[u8]) -> bool</h4></section></summary><divclass="docblock"><p>Checks that two slices are an ASCII case-insensitive match.</p>
<p>Same as <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>,
but without allocating and copying temporaries.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_ascii_uppercase"class="method"><spanclass="since rightside"title="Stable since Rust version 1.23.0">1.23.0</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>
<p>ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’,
but non-ASCII letters are unchanged.</p>
<p>To return a new uppercased value without modifying the existing one, use
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_ascii_lowercase"class="method"><spanclass="since rightside"title="Stable since Rust version 1.23.0">1.23.0</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>
<p>ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’,
but non-ASCII letters are unchanged.</p>
<p>To return a new lowercased value without modifying the existing one, use
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_ascii"class="method"><spanclass="since rightside"title="Stable since Rust version 1.60.0">1.60.0</span><h4class="code-header">pub fn <ahref="#method.escape_ascii"class="fn">escape_ascii</a>(&self) -> EscapeAscii<'_></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"><h4class="code-header">pub fn <ahref="#method.trim_ascii_start"class="fn">trim_ascii_start</a>(&self) ->&[u8]</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"><h4class="code-header">pub fn <ahref="#method.trim_ascii"class="fn">trim_ascii</a>(&self) ->&[u8]</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.as_str"class="method"><h4class="code-header">pub fn <ahref="#method.as_str"class="fn">as_str</a>(&self) ->&str</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"><h4class="code-header">pub fn <ahref="#method.as_bytes"class="fn">as_bytes</a>(&self) ->&[u8]</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.len"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</a>(&self) -> usize</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-1"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.is_empty-1"class="fn">is_empty</a>(&self) -> bool</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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.first"class="fn">first</a>(&self) -> Option<&T></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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.first_mut"class="fn">first_mut</a>(&mut self) -> Option<&mut T></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="since rightside"title="Stable since Rust version 1.5.0">1.5.0</span><h4class="code-header">pub fn <ahref="#method.split_first"class="fn">split_first</a>(&self) -> Option<(&T, &[T])></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="since rightside"title="Stable since Rust version 1.5.0">1.5.0</span><h4class="code-header">pub fn <ahref="#method.split_first_mut"class="fn">split_first_mut</a>(&mut self) -> Option<(&mut T, &mut [T])></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="since rightside"title="Stable since Rust version 1.5.0">1.5.0</span><h4class="code-header">pub fn <ahref="#method.split_last"class="fn">split_last</a>(&self) -> Option<(&T, &[T])></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="since rightside"title="Stable since Rust version 1.5.0">1.5.0</span><h4class="code-header">pub fn <ahref="#method.split_last_mut"class="fn">split_last_mut</a>(&mut self) -> Option<(&mut T, &mut [T])></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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.last"class="fn">last</a>(&self) -> Option<&T></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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.last_mut"class="fn">last_mut</a>(&mut self) -> Option<&mut T></h4></section></summary><divclass="docblock"><p>Returns a mutable pointer to the last item in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first_chunk"class="method"><h4class="code-header">pub fn <ahref="#method.first_chunk"class="fn">first_chunk</a><const N: usize>(&self) -> Option<&[T; N]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></summary><divclass="docblock"><p>Returns the first <code>N</code> elements of the slice, or <code>None</code> if it has fewer than <code>N</code> elements.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first_chunk_mut"class="method"><h4class="code-header">pub fn <ahref="#method.first_chunk_mut"class="fn">first_chunk_mut</a><const N: usize>(&mut self) -> Option<&mut [T; N]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></summary><divclass="docblock"><p>Returns a mutable reference to the first <code>N</code> elements of the slice,
or <code>None</code> if it has fewer than <code>N</code> elements.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_first_chunk"class="method"><h4class="code-header">pub fn <ahref="#method.split_first_chunk"class="fn">split_first_chunk</a><const N: usize>(&self) -> Option<(&[T; N], &[T])></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></summary><divclass="docblock"><p>Returns the first <code>N</code> elements of the slice and the remainder,
or <code>None</code> if it has fewer than <code>N</code> elements.</p>
) -> Option<(&mut [T; N], &mut [T])></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></summary><divclass="docblock"><p>Returns a mutable reference to the first <code>N</code> elements of the slice and the remainder,
or <code>None</code> if it has fewer than <code>N</code> elements.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_last_chunk"class="method"><h4class="code-header">pub fn <ahref="#method.split_last_chunk"class="fn">split_last_chunk</a><const N: usize>(&self) -> Option<(&[T; N], &[T])></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></summary><divclass="docblock"><p>Returns the last <code>N</code> elements of the slice and the remainder,
or <code>None</code> if it has fewer than <code>N</code> elements.</p>
) -> Option<(&mut [T; N], &mut [T])></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></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_chunk"class="method"><h4class="code-header">pub fn <ahref="#method.last_chunk"class="fn">last_chunk</a><const N: usize>(&self) -> Option<&[T; N]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></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_chunk_mut"class="method"><h4class="code-header">pub fn <ahref="#method.last_chunk_mut"class="fn">last_chunk_mut</a><const N: usize>(&mut self) -> Option<&mut [T; N]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_first_last_chunk</code>)</span></div></span></summary><divclass="docblock"><p>Returns a mutable pointer to the last item in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.get"class="fn">get</a><I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output><spanclass="where fmt-newline">where
I: SliceIndex<[T]>,</span></h4></section></summary><divclass="docblock"><p>Returns a reference to an element or subslice depending on the type of
index.</p>
<ul>
<li>If given a position, returns a reference to the element at that
position or <code>None</code> if out of bounds.</li>
<li>If given a range, returns the subslice corresponding to that range,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.get_mut"class="fn">get_mut</a><I>(
&mut self,
index: I
) -> Option<&mut <I as SliceIndex<[T]>>::Output><spanclass="where fmt-newline">where
I: SliceIndex<[T]>,</span></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to an element or subslice depending on the
type of index (see <ahref="slice::get"><code>get</code></a>) or <code>None</code> if the index is out of bounds.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_unchecked"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub unsafe fn <ahref="#method.get_unchecked"class="fn">get_unchecked</a><I>(
&self,
index: I
) ->&<I as SliceIndex<[T]>>::Output<spanclass="where fmt-newline">where
I: SliceIndex<[T]>,</span></h4></section></summary><divclass="docblock"><p>Returns a reference to an element or subslice, without doing bounds
checking.</p>
<p>For a safe alternative see <ahref="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>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_unchecked_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub unsafe fn <ahref="#method.get_unchecked_mut"class="fn">get_unchecked_mut</a><I>(
&mut self,
index: I
) ->&mut <I as SliceIndex<[T]>>::Output<spanclass="where fmt-newline">where
I: SliceIndex<[T]>,</span></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to an element or subslice, without doing
bounds checking.</p>
<p>For a safe alternative see <ahref="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>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr-1"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.as_ptr-1"class="fn">as_ptr</a>(&self) -> *const T</h4></section></summary><divclass="docblock"><p>Returns a raw pointer to the slice’s buffer.</p>
<p>The caller must ensure that the slice outlives the pointer this
function returns, or else it will end up pointing to garbage.</p>
<p>The caller must also ensure that the memory the pointer (non-transitively) points to
is never written to (except inside an <code>UnsafeCell</code>) using this pointer or any pointer
derived from it. If you need to mutate the contents of the slice, use <ahref="slice::as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
<p>Modifying the container referenced by this slice may cause its buffer
to be reallocated, which would also make any pointers to it invalid.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_ptr-1"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.as_mut_ptr-1"class="fn">as_mut_ptr</a>(&mut self) -> *mut T</h4></section></summary><divclass="docblock"><p>Returns an unsafe mutable pointer to the slice’s buffer.</p>
<p>The caller must ensure that the slice outlives the pointer this
function returns, or else it will end up pointing to garbage.</p>
<p>Modifying the container referenced by this slice may cause its buffer
to be reallocated, which would also make any pointers to it invalid.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr_range"class="method"><spanclass="since rightside"title="Stable since Rust version 1.48.0">1.48.0</span><h4class="code-header">pub fn <ahref="#method.as_ptr_range"class="fn">as_ptr_range</a>(&self) -> Range<*const T></h4></section></summary><divclass="docblock"><p>Returns the two raw pointers spanning the slice.</p>
<p>The returned range is half-open, which means that the end pointer
points <em>one past</em> the last element of the slice. This way, an empty
slice is represented by two equal pointers, and the difference between
the two pointers represents the size of the slice.</p>
<p>See <ahref="slice::as_ptr"><code>as_ptr</code></a> for warnings on using these pointers. The end pointer
requires extra caution, as it does not point to a valid element in the
slice.</p>
<p>This function is useful for interacting with foreign interfaces which
use two pointers to refer to a range of elements in memory, as is
common in C++.</p>
<p>It can also be useful to check if a pointer to an element refers to an
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_ptr_range"class="method"><spanclass="since rightside"title="Stable since Rust version 1.48.0">1.48.0</span><h4class="code-header">pub fn <ahref="#method.as_mut_ptr_range"class="fn">as_mut_ptr_range</a>(&mut self) -> Range<*mut T></h4></section></summary><divclass="docblock"><p>Returns the two unsafe mutable pointers spanning the slice.</p>
<p>The returned range is half-open, which means that the end pointer
points <em>one past</em> the last element of the slice. This way, an empty
slice is represented by two equal pointers, and the difference between
the two pointers represents the size of the slice.</p>
<p>See <ahref="slice::as_mut_ptr"><code>as_mut_ptr</code></a> for warnings on using these pointers. The end
pointer requires extra caution, as it does not point to a valid element
in the slice.</p>
<p>This function is useful for interacting with foreign interfaces which
use two pointers to refer to a range of elements in memory, as is
common in C++.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.swap"class="fn">swap</a>(&mut self, a: usize, b: usize)</h4></section></summary><divclass="docblock"><p>Swaps two elements in the slice.</p>
<p>If <code>a</code> equals to <code>b</code>, it’s guaranteed that elements won’t change value.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_unchecked"class="method"><h4class="code-header">pub unsafe fn <ahref="#method.swap_unchecked"class="fn">swap_unchecked</a>(&mut self, a: usize, b: usize)</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="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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.iter"class="fn">iter</a>(&self) -> Iter<'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over the slice.</p>
<p>The iterator yields all items from start to end.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.iter_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.iter_mut"class="fn">iter_mut</a>(&mut self) -> IterMut<'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator that allows modifying each value.</p>
<p>The iterator yields all items from start to end.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.windows"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.windows"class="fn">windows</a>(&self, size: usize) -> Windows<'_, T></h4></section></summary><divclass="docblock"><p>Returns an iterator over all contiguous windows of length
<code>size</code>. The windows overlap. If the slice is shorter than
<code>size</code>, the iterator returns no values.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chunks"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.chunks"class="fn">chunks</a>(&self, chunk_size: usize) -> Chunks<'_, 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
beginning of the slice.</p>
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
slice, then the last chunk will not have length <code>chunk_size</code>.</p>
<p>See <ahref="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="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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.chunks_mut"class="fn">chunks_mut</a>(&mut self, chunk_size: usize) -> ChunksMut<'_, 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
beginning of the slice.</p>
<p>The chunks are mutable slices, and do not overlap. If <code>chunk_size</code> does not divide the
length of the slice, then the last chunk will not have length <code>chunk_size</code>.</p>
<p>See <ahref="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="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="since rightside"title="Stable since Rust version 1.31.0">1.31.0</span><h4class="code-header">pub fn <ahref="#method.chunks_exact"class="fn">chunks_exact</a>(&self, chunk_size: usize) -> ChunksExact<'_, 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
beginning of the slice.</p>
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be retrieved
from the <code>remainder</code> function of the iterator.</p>
<p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
resulting code better than in the case of <ahref="slice::chunks"><code>chunks</code></a>.</p>
<p>See <ahref="slice::chunks"><code>chunks</code></a> for a variant of this iterator that also returns the remainder as a smaller
chunk, and <ahref="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="since rightside"title="Stable since Rust version 1.31.0">1.31.0</span><h4class="code-header">pub fn <ahref="#method.chunks_exact_mut"class="fn">chunks_exact_mut</a>(&mut self, chunk_size: usize) -> ChunksExactMut<'_, 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
beginning of the slice.</p>
<p>The chunks are mutable slices, and do not overlap. If <code>chunk_size</code> does not divide the
length of the slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be
retrieved from the <code>into_remainder</code> function of the iterator.</p>
<p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
resulting code better than in the case of <ahref="slice::chunks_mut"><code>chunks_mut</code></a>.</p>
<p>See <ahref="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="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"><h4class="code-header">pub unsafe fn <ahref="#method.as_chunks_unchecked"class="fn">as_chunks_unchecked</a><const N: usize>(&self) ->&[[T; N]]</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,
// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed</span></code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_chunks"class="method"><h4class="code-header">pub fn <ahref="#method.as_chunks"class="fn">as_chunks</a><const N: usize>(&self) -> (&[[T; N]], &[T])</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,
starting at the beginning of the slice,
and a remainder slice with length strictly less than <code>N</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_rchunks"class="method"><h4class="code-header">pub fn <ahref="#method.as_rchunks"class="fn">as_rchunks</a><const N: usize>(&self) -> (&[T], &[[T; N]])</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,
starting at the end of the slice,
and a remainder slice with length strictly less than <code>N</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.array_chunks"class="method"><h4class="code-header">pub fn <ahref="#method.array_chunks"class="fn">array_chunks</a><const N: usize>(&self) -> ArrayChunks<'_, 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
beginning of the slice.</p>
<p>The chunks are array references and do not overlap. If <code>N</code> does not divide the
length of the slice, then the last up to <code>N-1</code> elements will be omitted and can be
retrieved from the <code>remainder</code> function of the iterator.</p>
<p>This method is the const generic equivalent of <ahref="slice::chunks_exact"><code>chunks_exact</code></a>.</p>
) ->&mut [[T; N]]</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,
// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed</span></code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_chunks_mut"class="method"><h4class="code-header">pub fn <ahref="#method.as_chunks_mut"class="fn">as_chunks_mut</a><const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])</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,
starting at the beginning of the slice,
and a remainder slice with length strictly less than <code>N</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_rchunks_mut"class="method"><h4class="code-header">pub fn <ahref="#method.as_rchunks_mut"class="fn">as_rchunks_mut</a><const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])</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,
starting at the end of the slice,
and a remainder slice with length strictly less than <code>N</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.array_chunks_mut"class="method"><h4class="code-header">pub fn <ahref="#method.array_chunks_mut"class="fn">array_chunks_mut</a><const N: usize>(&mut self) -> ArrayChunksMut<'_, 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
beginning of the slice.</p>
<p>The chunks are mutable array references and do not overlap. If <code>N</code> does not divide
the length of the slice, then the last up to <code>N-1</code> elements will be omitted and
can be retrieved from the <code>into_remainder</code> function of the iterator.</p>
<p>This method is the const generic equivalent of <ahref="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"><h4class="code-header">pub fn <ahref="#method.array_windows"class="fn">array_windows</a><const N: usize>(&self) -> ArrayWindows<'_, 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,
starting at the beginning of the slice.</p>
<p>This is the const generic equivalent of <ahref="slice::windows"><code>windows</code></a>.</p>
<p>If <code>N</code> is greater than the size of the slice, it will return no windows.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rchunks"class="method"><spanclass="since rightside"title="Stable since Rust version 1.31.0">1.31.0</span><h4class="code-header">pub fn <ahref="#method.rchunks"class="fn">rchunks</a>(&self, chunk_size: usize) -> RChunks<'_, 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
of the slice.</p>
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
slice, then the last chunk will not have length <code>chunk_size</code>.</p>
<p>See <ahref="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="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="since rightside"title="Stable since Rust version 1.31.0">1.31.0</span><h4class="code-header">pub fn <ahref="#method.rchunks_mut"class="fn">rchunks_mut</a>(&mut self, chunk_size: usize) -> RChunksMut<'_, 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
of the slice.</p>
<p>The chunks are mutable slices, and do not overlap. If <code>chunk_size</code> does not divide the
length of the slice, then the last chunk will not have length <code>chunk_size</code>.</p>
<p>See <ahref="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="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="since rightside"title="Stable since Rust version 1.31.0">1.31.0</span><h4class="code-header">pub fn <ahref="#method.rchunks_exact"class="fn">rchunks_exact</a>(&self, chunk_size: usize) -> RChunksExact<'_, 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 of the slice.</p>
<p>The chunks are slices and do not overlap. If <code>chunk_size</code> does not divide the length of the
slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be retrieved
from the <code>remainder</code> function of the iterator.</p>
<p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
resulting code better than in the case of <ahref="slice::rchunks"><code>rchunks</code></a>.</p>
<p>See <ahref="slice::rchunks"><code>rchunks</code></a> for a variant of this iterator that also returns the remainder as a smaller
chunk, and <ahref="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="since rightside"title="Stable since Rust version 1.31.0">1.31.0</span><h4class="code-header">pub fn <ahref="#method.rchunks_exact_mut"class="fn">rchunks_exact_mut</a>(&mut self, chunk_size: usize) -> RChunksExactMut<'_, 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
of the slice.</p>
<p>The chunks are mutable slices, and do not overlap. If <code>chunk_size</code> does not divide the
length of the slice, then the last up to <code>chunk_size-1</code> elements will be omitted and can be
retrieved from the <code>into_remainder</code> function of the iterator.</p>
<p>Due to each chunk having exactly <code>chunk_size</code> elements, the compiler can often optimize the
resulting code better than in the case of <ahref="slice::chunks_mut"><code>chunks_mut</code></a>.</p>
<p>See <ahref="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="slice::chunks_exact_mut"><code>chunks_exact_mut</code></a> for the same iterator but starting at the beginning
F: FnMut(&T, &T) -> bool,</span></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_group_by</code>)</span></div></span></summary><divclass="docblock"><p>Returns an iterator over the slice producing non-overlapping runs
of elements using the predicate to separate them.</p>
<p>The predicate is called on two elements following themselves,
it means the predicate is called on <code>slice[0]</code> and <code>slice[1]</code>
then on <code>slice[1]</code> and <code>slice[2]</code> and so on.</p>
F: FnMut(&T, &T) -> bool,</span></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>slice_group_by</code>)</span></div></span></summary><divclass="docblock"><p>Returns an iterator over the slice producing non-overlapping mutable
runs of elements using the predicate to separate them.</p>
<p>The predicate is called on two elements following themselves,
it means the predicate is called on <code>slice[0]</code> and <code>slice[1]</code>
then on <code>slice[1]</code> and <code>slice[2]</code> and so on.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.split_at"class="fn">split_at</a>(&self, mid: usize) -> (&[T], &[T])</h4></section></summary><divclass="docblock"><p>Divides one slice into two at an index.</p>
<p>The first will contain all indices from <code>[0, mid)</code> (excluding
the index <code>mid</code> itself) and the second will contain all
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.split_at_mut"class="fn">split_at_mut</a>(&mut self, mid: usize) -> (&mut [T], &mut [T])</h4></section></summary><divclass="docblock"><p>Divides one mutable slice into two at an index.</p>
<p>The first will contain all indices from <code>[0, mid)</code> (excluding
the index <code>mid</code> itself) and the second will contain all
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at_unchecked"class="method"><h4class="code-header">pub unsafe fn <ahref="#method.split_at_unchecked"class="fn">split_at_unchecked</a>(&self, mid: usize) -> (&[T], &[T])</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>The first will contain all indices from <code>[0, mid)</code> (excluding
the index <code>mid</code> itself) and the second will contain all
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
<p>For a safe alternative see <ahref="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 [T], &mut [T])</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>The first will contain all indices from <code>[0, mid)</code> (excluding
the index <code>mid</code> itself) and the second will contain all
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p>
<p>For a safe alternative see <ahref="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_array_ref"class="method"><h4class="code-header">pub fn <ahref="#method.split_array_ref"class="fn">split_array_ref</a><const N: usize>(&self) -> (&[T; N], &[T])</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>split_array</code>)</span></div></span></summary><divclass="docblock"><p>Divides one slice into an array and a remainder slice at an index.</p>
<p>The array will contain all indices from <code>[0, N)</code> (excluding
the index <code>N</code> itself) and the slice will contain all
indices from <code>[N, len)</code> (excluding the index <code>len</code> itself).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_array_mut"class="method"><h4class="code-header">pub fn <ahref="#method.split_array_mut"class="fn">split_array_mut</a><const N: usize>(&mut self) -> (&mut [T; N], &mut [T])</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>split_array</code>)</span></div></span></summary><divclass="docblock"><p>Divides one mutable slice into an array and a remainder slice at an index.</p>
<p>The array will contain all indices from <code>[0, N)</code> (excluding
the index <code>N</code> itself) and the slice will contain all
indices from <code>[N, len)</code> (excluding the index <code>len</code> itself).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit_array_ref"class="method"><h4class="code-header">pub fn <ahref="#method.rsplit_array_ref"class="fn">rsplit_array_ref</a><const N: usize>(&self) -> (&[T], &[T; N])</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>split_array</code>)</span></div></span></summary><divclass="docblock"><p>Divides one slice into an array and a remainder slice at an index from
the end.</p>
<p>The slice will contain all indices from <code>[0, len - N)</code> (excluding
the index <code>len - N</code> itself) and the array will contain all
indices from <code>[len - N, len)</code> (excluding the index <code>len</code> itself).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit_array_mut"class="method"><h4class="code-header">pub fn <ahref="#method.rsplit_array_mut"class="fn">rsplit_array_mut</a><const N: usize>(&mut self) -> (&mut [T], &mut [T; N])</h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>split_array</code>)</span></div></span></summary><divclass="docblock"><p>Divides one mutable slice into an array and a remainder slice at an
index from the end.</p>
<p>The slice will contain all indices from <code>[0, len - N)</code> (excluding
the index <code>N</code> itself) and the array will contain all
indices from <code>[len - N, len)</code> (excluding the index <code>len</code> itself).</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.split"class="fn">split</a><F>(&self, pred: F) -> Split<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
<code>pred</code>. The matched element is not contained in the subslices.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.split_mut"class="fn">split_mut</a><F>(&mut self, pred: F) -> SplitMut<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that
match <code>pred</code>. The matched element is not contained in the subslices.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_inclusive"class="method"><spanclass="since rightside"title="Stable since Rust version 1.51.0">1.51.0</span><h4class="code-header">pub fn <ahref="#method.split_inclusive"class="fn">split_inclusive</a><F>(&self, pred: F) -> SplitInclusive<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
<code>pred</code>. The matched element is contained in the end of the previous
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_inclusive_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.51.0">1.51.0</span><h4class="code-header">pub fn <ahref="#method.split_inclusive_mut"class="fn">split_inclusive_mut</a><F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that
match <code>pred</code>. The matched element is contained in the previous
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit"class="method"><spanclass="since rightside"title="Stable since Rust version 1.27.0">1.27.0</span><h4class="code-header">pub fn <ahref="#method.rsplit"class="fn">rsplit</a><F>(&self, pred: F) -> RSplit<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
<code>pred</code>, starting at the end of the slice and working backwards.
The matched element is not contained in the subslices.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.27.0">1.27.0</span><h4class="code-header">pub fn <ahref="#method.rsplit_mut"class="fn">rsplit_mut</a><F>(&mut self, pred: F) -> RSplitMut<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that
match <code>pred</code>, starting at the end of the slice and working
backwards. The matched element is not contained in the subslices.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.splitn"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.splitn"class="fn">splitn</a><F>(&self, n: usize, pred: F) -> SplitN<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
<code>pred</code>, limited to returning at most <code>n</code> items. The matched element is
not contained in the subslices.</p>
<p>The last element returned, if any, will contain the remainder of the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.splitn_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.splitn_mut"class="fn">splitn_mut</a><F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over mutable subslices separated by elements that match
<code>pred</code>, limited to returning at most <code>n</code> items. The matched element is
not contained in the subslices.</p>
<p>The last element returned, if any, will contain the remainder of the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplitn"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.rsplitn"class="fn">rsplitn</a><F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
<code>pred</code> limited to returning at most <code>n</code> items. This starts at the end of
the slice and works backwards. The matched element is not contained in
the subslices.</p>
<p>The last element returned, if any, will contain the remainder of the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplitn_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.rsplitn_mut"class="fn">rsplitn_mut</a><F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F><spanclass="where fmt-newline">where
F: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns an iterator over subslices separated by elements that match
<code>pred</code> limited to returning at most <code>n</code> items. This starts at the end of
the slice and works backwards. The matched element is not contained in
the subslices.</p>
<p>The last element returned, if any, will contain the remainder of the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.contains"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.contains"class="fn">contains</a>(&self, x: &T) -> bool<spanclass="where fmt-newline">where
T: PartialEq<T>,</span></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if the slice contains an element with the given value.</p>
<p>This operation is <em>O</em>(<em>n</em>).</p>
<p>Note that if you have a sorted slice, <ahref="slice::binary_search"><code>binary_search</code></a> may be faster.</p>
<p>If you do not have a <code>&T</code>, but some other value that you can compare
with one (for example, <code>String</code> implements <code>PartialEq<str></code>), you can
use <code>iter().any</code>:</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v = [String::from(<spanclass="string">"hello"</span>), String::from(<spanclass="string">"world"</span>)]; <spanclass="comment">// slice of `String`
</span><spanclass="macro">assert!</span>(v.iter().any(|e| e == <spanclass="string">"hello"</span>)); <spanclass="comment">// search with `&str`
</span><spanclass="macro">assert!</span>(!v.iter().any(|e| e == <spanclass="string">"hi"</span>));</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.starts_with-1"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.starts_with-1"class="fn">starts_with</a>(&self, needle: &[T]) -> bool<spanclass="where fmt-newline">where
T: PartialEq<T>,</span></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-1"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.ends_with-1"class="fn">ends_with</a>(&self, needle: &[T]) -> bool<spanclass="where fmt-newline">where
T: PartialEq<T>,</span></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if <code>needle</code> is a suffix of the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.binary_search"class="method"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.binary_search"class="fn">binary_search</a>(&self, x: &T) -> Result<usize, usize><spanclass="where fmt-newline">where
T: Ord,</span></h4></section></summary><divclass="docblock"><p>Binary searches this slice for a given element.
If the slice is not sorted, the returned result is unspecified and
meaningless.</p>
<p>If the value is found then [<code>Result::Ok</code>] is returned, containing the
index of the matching element. If there are multiple matches, then any
one of the matches could be returned. The index is chosen
deterministically, but is subject to change in future versions of Rust.
If the value is not found then [<code>Result::Err</code>] is returned, containing
the index where a matching element could be inserted while maintaining
sorted order.</p>
<p>See also <ahref="slice::binary_search_by"><code>binary_search_by</code></a>, <ahref="slice::binary_search_by_key"><code>binary_search_by_key</code></a>, and <ahref="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="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><h4class="code-header">pub fn <ahref="#method.binary_search_by"class="fn">binary_search_by</a><'a, F>(&'a self, f: F) -> Result<usize, usize><spanclass="where fmt-newline">where
F: FnMut(&'a T) -> Ordering,</span></h4></section></summary><divclass="docblock"><p>Binary searches this slice with a comparator function.</p>
<p>The comparator function should return an order code that indicates
whether its argument is <code>Less</code>, <code>Equal</code> or <code>Greater</code> the desired
target.
If the slice is not sorted or if the comparator function does not
implement an order consistent with the sort order of the underlying
slice, the returned result is unspecified and meaningless.</p>
<p>If the value is found then [<code>Result::Ok</code>] is returned, containing the
index of the matching element. If there are multiple matches, then any
one of the matches could be returned. The index is chosen
deterministically, but is subject to change in future versions of Rust.
If the value is not found then [<code>Result::Err</code>] is returned, containing
the index where a matching element could be inserted while maintaining
sorted order.</p>
<p>See also <ahref="slice::binary_search"><code>binary_search</code></a>, <ahref="slice::binary_search_by_key"><code>binary_search_by_key</code></a>, and <ahref="slice::partition_point"><code>partition_point</code></a>.</p>
B: Ord,</span></h4></section></summary><divclass="docblock"><p>Binary searches this slice with a key extraction function.</p>
<p>Assumes that the slice is sorted by the key, for instance with
<ahref="slice::sort_by_key"><code>sort_by_key</code></a> using the same key extraction function.
If the slice is not sorted by the key, the returned result is
unspecified and meaningless.</p>
<p>If the value is found then [<code>Result::Ok</code>] is returned, containing the
index of the matching element. If there are multiple matches, then any
one of the matches could be returned. The index is chosen
deterministically, but is subject to change in future versions of Rust.
If the value is not found then [<code>Result::Err</code>] is returned, containing
the index where a matching element could be inserted while maintaining
sorted order.</p>
<p>See also <ahref="slice::binary_search"><code>binary_search</code></a>, <ahref="slice::binary_search_by"><code>binary_search_by</code></a>, and <ahref="slice::partition_point"><code>partition_point</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_unstable_by"class="method"><spanclass="since rightside"title="Stable since Rust version 1.20.0">1.20.0</span><h4class="code-header">pub fn <ahref="#method.sort_unstable_by"class="fn">sort_unstable_by</a><F>(&mut self, compare: F)<spanclass="where fmt-newline">where
F: FnMut(&T, &T) -> Ordering,</span></h4></section></summary><divclass="docblock"><p>Sorts the slice with a comparator function, but might not preserve the order of equal
elements.</p>
<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>
</ul>
<p>For example, while [<code>f64</code>] doesn’t implement [<code>Ord</code>] because <code>NaN != NaN</code>, we can use
<code>partial_cmp</code> as our sort function when we know the slice doesn’t contain a <code>NaN</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_unstable_by_key"class="method"><spanclass="since rightside"title="Stable since Rust version 1.20.0">1.20.0</span><h4class="code-header">pub fn <ahref="#method.sort_unstable_by_key"class="fn">sort_unstable_by_key</a><K, F>(&mut self, f: F)<spanclass="where fmt-newline">where
F: FnMut(&T) -> K,
K: Ord,</span></h4></section></summary><divclass="docblock"><p>Sorts the slice with a key extraction function, but might not preserve the order of equal
elements.</p>
<p>This sort is unstable (i.e., may reorder equal elements), in-place
(i.e., does not allocate), and <em>O</em>(<em>m</em> * <em>n</em> * log(<em>n</em>)) worst-case, where the key function is
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.select_nth_unstable"class="method"><spanclass="since rightside"title="Stable since Rust version 1.49.0">1.49.0</span><h4class="code-header">pub fn <ahref="#method.select_nth_unstable"class="fn">select_nth_unstable</a>(
T: Ord,</span></h4></section></summary><divclass="docblock"><p>Reorder the slice such that the element at <code>index</code> is at its final sorted position.</p>
<p>This reordering has the additional property that any value at position <code>i < index</code> will be
less than or equal to any value at a position <code>j > index</code>. Additionally, this reordering is
unstable (i.e. any number of equal elements may end up at position <code>index</code>), in-place
(i.e. does not allocate), and runs in <em>O</em>(<em>n</em>) time.
This function is also known as “kth element” in other libraries.</p>
<p>It returns a triplet of the following from the reordered slice:
the subslice prior to <code>index</code>, the element at <code>index</code>, and the subslice after <code>index</code>;
accordingly, the values in those two subslices will respectively all be less-than-or-equal-to
and greater-than-or-equal-to the value of the element at <code>index</code>.</p>
v == [-<spanclass="number">5</span>, -<spanclass="number">3</span>, <spanclass="number">1</span>, <spanclass="number">2</span>, <spanclass="number">4</span>] ||
v == [-<spanclass="number">3</span>, -<spanclass="number">5</span>, <spanclass="number">1</span>, <spanclass="number">4</span>, <spanclass="number">2</span>] ||
v == [-<spanclass="number">5</span>, -<spanclass="number">3</span>, <spanclass="number">1</span>, <spanclass="number">4</span>, <spanclass="number">2</span>]);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.select_nth_unstable_by"class="method"><spanclass="since rightside"title="Stable since Rust version 1.49.0">1.49.0</span><h4class="code-header">pub fn <ahref="#method.select_nth_unstable_by"class="fn">select_nth_unstable_by</a><F>(
F: FnMut(&T, &T) -> Ordering,</span></h4></section></summary><divclass="docblock"><p>Reorder the slice with a comparator function such that the element at <code>index</code> is at its
final sorted position.</p>
<p>This reordering has the additional property that any value at position <code>i < index</code> will be
less than or equal to any value at a position <code>j > index</code> using the comparator function.
Additionally, this reordering is unstable (i.e. any number of equal elements may end up at
position <code>index</code>), in-place (i.e. does not allocate), and runs in <em>O</em>(<em>n</em>) time.
This function is also known as “kth element” in other libraries.</p>
<p>It returns a triplet of the following from
the slice reordered according to the provided comparator function: the subslice prior to
<code>index</code>, the element at <code>index</code>, and the subslice after <code>index</code>; accordingly, the values in
those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to
the value of the element at <code>index</code>.</p>
v == [<spanclass="number">2</span>, <spanclass="number">4</span>, <spanclass="number">1</span>, -<spanclass="number">3</span>, -<spanclass="number">5</span>] ||
v == [<spanclass="number">4</span>, <spanclass="number">2</span>, <spanclass="number">1</span>, -<spanclass="number">5</span>, -<spanclass="number">3</span>] ||
v == [<spanclass="number">4</span>, <spanclass="number">2</span>, <spanclass="number">1</span>, -<spanclass="number">3</span>, -<spanclass="number">5</span>]);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.select_nth_unstable_by_key"class="method"><spanclass="since rightside"title="Stable since Rust version 1.49.0">1.49.0</span><h4class="code-header">pub fn <ahref="#method.select_nth_unstable_by_key"class="fn">select_nth_unstable_by_key</a><K, F>(
K: Ord,</span></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
final sorted position.</p>
<p>This reordering has the additional property that any value at position <code>i < index</code> will be
less than or equal to any value at a position <code>j > index</code> using the key extraction function.
Additionally, this reordering is unstable (i.e. any number of equal elements may end up at
position <code>index</code>), in-place (i.e. does not allocate), and runs in <em>O</em>(<em>n</em>) time.
This function is also known as “kth element” in other libraries.</p>
<p>It returns a triplet of the following from
the slice reordered according to the provided key extraction function: the subslice prior to
<code>index</code>, the element at <code>index</code>, and the subslice after <code>index</code>; accordingly, the values in
those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to
the value of the element at <code>index</code>.</p>
T: PartialEq<T>,</span></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: FnMut(&mut T, &mut T) -> bool,</span></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
a given equality relation.</p>
<p>Returns two slices. The first contains no consecutive repeated elements.
The second contains all the duplicates in no specified order.</p>
<p>The <code>same_bucket</code> function is passed references to two elements from the slice and
must determine if the elements compare equal. The elements are passed in opposite order
from their order in the slice, so if <code>same_bucket(a, b)</code> returns <code>true</code>, <code>a</code> is moved
at the end of the slice.</p>
<p>If the slice is sorted, the first returned slice contains no duplicates.</p>
K: PartialEq<K>,</span></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
to the same key.</p>
<p>Returns two slices. The first contains no consecutive repeated elements.
The second contains all the duplicates in no specified order.</p>
<p>If the slice is sorted, the first returned slice contains no duplicates.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rotate_left"class="method"><spanclass="since rightside"title="Stable since Rust version 1.26.0">1.26.0</span><h4class="code-header">pub fn <ahref="#method.rotate_left"class="fn">rotate_left</a>(&mut self, mid: usize)</h4></section></summary><divclass="docblock"><p>Rotates the slice in-place such that the first <code>mid</code> elements of the
slice move to the end while the last <code>self.len() - mid</code> elements move to
the front. After calling <code>rotate_left</code>, the element previously at index
<code>mid</code> will become the first element in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rotate_right"class="method"><spanclass="since rightside"title="Stable since Rust version 1.26.0">1.26.0</span><h4class="code-header">pub fn <ahref="#method.rotate_right"class="fn">rotate_right</a>(&mut self, k: usize)</h4></section></summary><divclass="docblock"><p>Rotates the slice in-place such that the first <code>self.len() - k</code>
elements of the slice move to the end while the last <code>k</code> elements move
to the front. After calling <code>rotate_right</code>, the element previously at
index <code>self.len() - k</code> will become the first element in the slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.fill_with"class="method"><spanclass="since rightside"title="Stable since Rust version 1.51.0">1.51.0</span><h4class="code-header">pub fn <ahref="#method.fill_with"class="fn">fill_with</a><F>(&mut self, f: F)<spanclass="where fmt-newline">where
F: FnMut() -> T,</span></h4></section></summary><divclass="docblock"><p>Fills <code>self</code> with elements returned by calling a closure repeatedly.</p>
<p>This method uses a closure to create new values. If you’d rather
[<code>Clone</code>] a given value, use <ahref="slice::fill"><code>fill</code></a>. If you want to use the [<code>Default</code>]
trait to generate values, you can pass [<code>Default::default</code>] as the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_with_slice"class="method"><spanclass="since rightside"title="Stable since Rust version 1.27.0">1.27.0</span><h4class="code-header">pub fn <ahref="#method.swap_with_slice"class="fn">swap_with_slice</a>(&mut self, other: &mut [T])</h4></section></summary><divclass="docblock"><p>Swaps all elements in <code>self</code> with those in <code>other</code>.</p>
<p>The length of <code>other</code> must be the same as <code>self</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.align_to"class="method"><spanclass="since rightside"title="Stable since Rust version 1.30.0">1.30.0</span><h4class="code-header">pub unsafe fn <ahref="#method.align_to"class="fn">align_to</a><U>(&self) -> (&[T], &[U], &[T])</h4></section></summary><divclass="docblock"><p>Transmute the slice to a slice of another type, ensuring alignment of the types is
maintained.</p>
<p>This method splits the slice into three distinct slices: prefix, correctly aligned middle
slice of a new type, and the suffix slice. How exactly the slice is split up is not
specified; the middle part may be smaller than necessary. However, if this fails to return a
maximal middle part, that is because code is running in a context where performance does not
matter, such as a sanitizer attempting to find alignment bugs. Regular code running
in a default (debug or release) execution <em>will</em> return a maximal middle part.</p>
<p>This method has no purpose when either input element <code>T</code> or output element <code>U</code> are
zero-sized and will return the original slice without splitting anything.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.align_to_mut"class="method"><spanclass="since rightside"title="Stable since Rust version 1.30.0">1.30.0</span><h4class="code-header">pub unsafe fn <ahref="#method.align_to_mut"class="fn">align_to_mut</a><U>(&mut self) -> (&mut [T], &mut [U], &mut [T])</h4></section></summary><divclass="docblock"><p>Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the
types is maintained.</p>
<p>This method splits the slice into three distinct slices: prefix, correctly aligned middle
slice of a new type, and the suffix slice. How exactly the slice is split up is not
specified; the middle part may be smaller than necessary. However, if this fails to return a
maximal middle part, that is because code is running in a context where performance does not
matter, such as a sanitizer attempting to find alignment bugs. Regular code running
in a default (debug or release) execution <em>will</em> return a maximal middle part.</p>
<p>This method has no purpose when either input element <code>T</code> or output element <code>U</code> are
zero-sized and will return the original slice without splitting anything.</p>
LaneCount<LANES>: SupportedLaneCount,</span></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 [<code>slice::align_to</code>], so has the same weak
postconditions as that method. You’re only assured that
LaneCount<LANES>: SupportedLaneCount,</span></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,
and a mutable suffix.</p>
<p>This is a safe wrapper around [<code>slice::align_to_mut</code>], so has the same weak
postconditions as that method. You’re only assured that
T: PartialOrd<T>,</span></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>
<p>That is, for each element <code>a</code> and its following element <code>b</code>, <code>a <= b</code> must hold. If the
slice yields exactly zero or one element, <code>true</code> is returned.</p>
<p>Note that if <code>Self::Item</code> is only <code>PartialOrd</code>, but not <code>Ord</code>, the above definition
implies that this function returns <code>false</code> if any two consecutive items are not
F: FnMut(&'a T, &'a T) -> Option<Ordering>,</span></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>
<p>Instead of using <code>PartialOrd::partial_cmp</code>, this function uses the given <code>compare</code>
function to determine the ordering of two elements. Apart from that, it’s equivalent to
<ahref="slice::is_sorted"><code>is_sorted</code></a>; see its documentation for more information.</p>
K: PartialOrd<K>,</span></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>
<p>Instead of comparing the slice’s elements directly, this function compares the keys of the
elements, as determined by <code>f</code>. Apart from that, it’s equivalent to <ahref="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="since rightside"title="Stable since Rust version 1.52.0">1.52.0</span><h4class="code-header">pub fn <ahref="#method.partition_point"class="fn">partition_point</a><P>(&self, pred: P) -> usize<spanclass="where fmt-newline">where
P: FnMut(&T) -> bool,</span></h4></section></summary><divclass="docblock"><p>Returns the index of the partition point according to the given predicate
(the index of the first element of the second partition).</p>
<p>The slice is assumed to be partitioned according to the given predicate.
This means that all elements for which the predicate returns true are at the start of the slice
and all elements for which the predicate returns false are at the end.
For example, <code>[7, 15, 3, 5, 4, 12, 6]</code> is partitioned under the predicate <code>x % 2 != 0</code>
(all odd numbers are at the start, all even at the end).</p>
<p>If this slice is not partitioned, the returned result is unspecified and meaningless,
as this method performs a kind of binary search.</p>
<p>See also <ahref="slice::binary_search"><code>binary_search</code></a>, <ahref="slice::binary_search_by"><code>binary_search_by</code></a>, and <ahref="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: OneSidedRange<usize>,</span></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
and returns a reference to it.</p>
<p>Returns <code>None</code> and does not modify the slice if the given
range is out of bounds.</p>
<p>Note that this method only accepts one-sided ranges such as
<code>2..</code> or <code>..6</code>, but not <code>2..6</code>.</p>
R: OneSidedRange<usize>,</span></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
and returns a mutable reference to it.</p>
<p>Returns <code>None</code> and does not modify the slice if the given
range is out of bounds.</p>
<p>Note that this method only accepts one-sided ranges such as
<code>2..</code> or <code>..6</code>, but not <code>2..6</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_first"class="method"><h4class="code-header">pub fn <ahref="#method.take_first"class="fn">take_first</a><'a>(self: &mut &'a [T]) -> Option<&'a T></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
to it.</p>
<p>Returns <code>None</code> if the slice is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_first_mut"class="method"><h4class="code-header">pub fn <ahref="#method.take_first_mut"class="fn">take_first_mut</a><'a>(self: &mut &'a mut [T]) -> Option<&'a mut T></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
reference to it.</p>
<p>Returns <code>None</code> if the slice is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_last"class="method"><h4class="code-header">pub fn <ahref="#method.take_last"class="fn">take_last</a><'a>(self: &mut &'a [T]) -> Option<&'a T></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
to it.</p>
<p>Returns <code>None</code> if the slice is empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.take_last_mut"class="method"><h4class="code-header">pub fn <ahref="#method.take_last_mut"class="fn">take_last_mut</a><'a>(self: &mut &'a mut [T]) -> Option<&'a mut T></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
reference to it.</p>
<p>Returns <code>None</code> if the slice is empty.</p>
) -> [&mut T; 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, without doing any checks.</p>
<p>For a safe alternative see <ahref="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>
) -> Result<[&mut T; N], GetManyMutError<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>
<p>Returns an error if any index is out-of-bounds, or if the same index was
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_floats"class="method"><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>
<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
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort_floats-1"class="method"><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
</div></details></div><h2id="trait-implementations"class="small-section-header">Trait Implementations<ahref="#trait-implementations"class="anchor">§</a></h2><divid="trait-implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsMut%3C%5BT%5D%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1178-1183">source</a><ahref="#impl-AsMut%3C%5BT%5D%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> AsMut<[T]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut-1"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1180-1182">source</a><ahref="#method.as_mut-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">as_mut</a>(&mut self) ->&mut [T]</h4></section></summary><divclass='docblock'>Converts this type into a mutable reference of the (usually inferred) input type.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsMut%3CVec%3CT,+N%3E%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1164-1169">source</a><ahref="#impl-AsMut%3CVec%3CT,+N%3E%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> AsMut<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N>> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1166-1168">source</a><ahref="#method.as_mut"class="anchor">§</a><h4class="code-header">fn <aclass="fn">as_mut</a>(&mut self) ->&mut Self</h4></section></summary><divclass='docblock'>Converts this type into a mutable reference of the (usually inferred) input type.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsRef%3C%5BT%5D%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1171-1176">source</a><ahref="#impl-AsRef%3C%5BT%5D%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> AsRef<[T]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ref-1"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1173-1175">source</a><ahref="#method.as_ref-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">as_ref</a>(&self) ->&[T]</h4></section></summary><divclass='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsRef%3CVec%3CT,+N%3E%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1157-1162">source</a><ahref="#impl-AsRef%3CVec%3CT,+N%3E%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> AsRef<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N>> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ref"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1159-1161">source</a><ahref="#method.as_ref"class="anchor">§</a><h4class="code-header">fn <aclass="fn">as_ref</a>(&self
I: IntoIterator<Item = &'a T>,</span></h4></section></summary><divclass='docblock'>Extends a collection with the contents of an iterator. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_one"class="method trait-impl"><ahref="#method.extend_one"class="anchor">§</a><h4class="code-header">fn <aclass="fn">extend_one</a>(&mut self, item: A)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Extends a collection with exactly one element.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_reserve"class="method trait-impl"><ahref="#method.extend_reserve"class="anchor">§</a><h4class="code-header">fn <aclass="fn">extend_reserve</a>(&mut self, additional: usize)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Reserves capacity in a collection for the given number of additional elements. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Extend%3CT%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#871-878">source</a><ahref="#impl-Extend%3CT%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> Extend<T> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend-2"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#872-877">source</a><ahref="#method.extend-2"class="anchor">§</a><h4class="code-header">fn <aclass="fn">extend</a><I>(&mut self, iter: I)<spanclass="where fmt-newline">where
I: IntoIterator<Item = T>,</span></h4></section></summary><divclass='docblock'>Extends a collection with the contents of an iterator. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_one-1"class="method trait-impl"><ahref="#method.extend_one-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">extend_one</a>(&mut self, item: A)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Extends a collection with exactly one element.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_reserve-1"class="method trait-impl"><ahref="#method.extend_reserve-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">extend_reserve</a>(&mut self, additional: usize)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Reserves capacity in a collection for the given number of additional elements. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-FromIterator%3CT%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#928-939">source</a><ahref="#impl-FromIterator%3CT%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> FromIterator<T> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from_iter"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#929-938">source</a><ahref="#method.from_iter"class="anchor">§</a><h4class="code-header">fn <aclass="fn">from_iter</a><I>(iter: I) -> Self<spanclass="where fmt-newline">where
I: IntoIterator<Item = T>,</span></h4></section></summary><divclass='docblock'>Creates a value from an iterator. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Hash-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#892-899">source</a><ahref="#impl-Hash-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> Hash for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N><spanclass="where fmt-newline">where
T: Hash,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#896-898">source</a><ahref="#method.hash"class="anchor">§</a><h4class="code-header">fn <aclass="fn">hash</a><H: Hasher>(&self, state: &mut H)</h4></section></summary><divclass='docblock'>Feeds this value into the given [<code>Hasher</code>]. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash_slice"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.3.0">1.3.0</span><ahref="#method.hash_slice"class="anchor">§</a><h4class="code-header">fn <aclass="fn">hash_slice</a><H>(data: &[Self], state: &mut H)<spanclass="where fmt-newline">where
H: Hasher,
Self: Sized,</span></h4></section></summary><divclass='docblock'>Feeds a slice of this type into the given [<code>Hasher</code>]. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Hash-for-Vec%3CT,+N%3E-1"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#901-908">source</a><ahref="#impl-Hash-for-Vec%3CT,+N%3E-1"class="anchor">§</a><h3class="code-header">impl<T, const N: usize><aclass="trait"href="../hash32/trait.Hash.html"title="trait hash32::Hash">Hash</a> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N><spanclass="where fmt-newline">where
T: <aclass="trait"href="../hash32/trait.Hash.html"title="trait hash32::Hash">Hash</a>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash-1"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#905-907">source</a><ahref="#method.hash-1"class="anchor">§</a><h4class="code-header">fn <ahref="../hash32/trait.Hash.html#tymethod.hash"class="fn">hash</a><H: <aclass="trait"href="../hash32/trait.Hasher.html"title="trait hash32::Hasher">Hasher</a>>(&self, state: &mut H)</h4></section></summary><divclass='docblock'>Feeds this value into the given <code>Hasher</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash_slice-1"class="method trait-impl"><aclass="src rightside"href="../src/hash32/lib.rs.html#192-195">source</a><ahref="#method.hash_slice-1"class="anchor">§</a><h4class="code-header">fn <ahref="../hash32/trait.Hash.html#method.hash_slice"class="fn">hash_slice</a><H>(data: &[Self], state: &mut H)<spanclass="where fmt-newline">where
Self: Sized,</span></h4></section></summary><divclass='docblock'>Feeds a slice of this type into the given <code>Hasher</code>.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-IntoIterator-for-%26'a+Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#910-917">source</a><ahref="#impl-IntoIterator-for-%26'a+Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<'a, T, const N: usize> IntoIterator for &'a <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Item-1"class="associatedtype trait-impl"><ahref="#associatedtype.Item-1"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Item</a> = &'a T</h4></section></summary><divclass='docblock'>The type of the elements being iterated over.</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.IntoIter-1"class="associatedtype trait-impl"><ahref="#associatedtype.IntoIter-1"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">IntoIter</a> = Iter<'a, T></h4></section></summary><divclass='docblock'>Which kind of iterator are we turning this into?</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_iter-1"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#914-916">source</a><ahref="#method.into_iter-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">into_iter</a>(self) -> Self::IntoIter</h4></section></summary><divclass='docblock'>Creates an iterator from a value. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-IntoIterator-for-%26'a+mut+Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#919-926">source</a><ahref="#impl-IntoIterator-for-%26'a+mut+Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<'a, T, const N: usize> IntoIterator for &'a mut <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Item"class="associatedtype trait-impl"><ahref="#associatedtype.Item"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Item</a> = &'a mut T</h4></section></summary><divclass='docblock'>The type of the elements being iterated over.</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.IntoIter"class="associatedtype trait-impl"><ahref="#associatedtype.IntoIter"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">IntoIter</a> = IterMut<'a, T></h4></section></summary><divclass='docblock'>Which kind of iterator are we turning this into?</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_iter"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#923-925">source</a><ahref="#method.into_iter"class="anchor">§</a><h4class="code-header">fn <aclass="fn">into_iter</a>(self) -> Self::IntoIter</h4></section></summary><divclass='docblock'>Creates an iterator from a value. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-IntoIterator-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#999-1006">source</a><ahref="#impl-IntoIterator-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> IntoIterator for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Item-2"class="associatedtype trait-impl"><ahref="#ass
T: Ord,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.cmp"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1138-1140">source</a><ahref="#method.cmp"class="anchor">§</a><h4class="code-header">fn <aclass="fn">cmp</a>(&self, other: &Self) -> Ordering</h4></section></summary><divclass='docblock'>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.max"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.21.0">1.21.0</span><ahref="#method.max"class="anchor">§</a><h4class="code-header">fn <aclass="fn">max</a>(self, other: Self) -> Self<spanclass="where fmt-newline">where
Self: Sized,</span></h4></section></summary><divclass='docblock'>Compares and returns the maximum of two values. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.min"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.21.0">1.21.0</span><ahref="#method.min"class="anchor">§</a><h4class="code-header">fn <aclass="fn">min</a>(self, other: Self) -> Self<spanclass="where fmt-newline">where
Self: Sized,</span></h4></section></summary><divclass='docblock'>Compares and returns the minimum of two values. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clamp"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.50.0">1.50.0</span><ahref="#method.clamp"class="anchor">§</a><h4class="code-header">fn <aclass="fn">clamp</a>(self, min: Self, max: Self) -> Self<spanclass="where fmt-newline">where
Self: Sized + PartialOrd<Self>,</span></h4></section></summary><divclass='docblock'>Restrict a value to a certain interval. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%26%5BB%5D%3E-for-Vec%3CA,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1038-1045">source</a><ahref="#impl-PartialEq%3C%26%5BB%5D%3E-for-Vec%3CA,+N%3E"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize> PartialEq<&[B]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N><spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-9"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1042-1044">source</a><ahref="#method.eq-9"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &&[B]) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-9"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-9"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%26%5BB;+M%5D%3E-for-Vec%3CA,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1101-1108">source</a><ahref="#impl-PartialEq%3C%26%5BB;+M%5D%3E-for-Vec%3CA,+N%3E"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize, const M: usize> PartialEq<&[B; M]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N><spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-6"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1105-1107">source</a><ahref="#method.eq-6"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &&[B; M]) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-6"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-6"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%26mut+%5BB%5D%3E-for-Vec%3CA,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1058-1065">source</a><ahref="#impl-PartialEq%3C%26mut+%5BB%5D%3E-for-Vec%3CA,+N%3E"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize> PartialEq<&mut [B]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N><spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-4"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1062-1064">source</a><ahref="#method.eq-4"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &&mut [B]) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-4"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-4"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%5BB%5D%3E-for-Vec%3CA,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1018-1025">source</a><ahref="#impl-PartialEq%3C%5BB%5D%3E-for-Vec%3CA,+N%3E"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize> PartialEq<[B]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N><spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-2"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1022-1024">source</a><ahref="#method.eq-2"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &[B]) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-2"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-2"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%5BB;+M%5D%3E-for-Vec%3CA,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1079-1086">source</a><ahref="#impl-PartialEq%3C%5BB;+M%5D%3E-for-Vec%3CA,+N%3E"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize, const M: usize> PartialEq<[B; M]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N><spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-7"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1083-1085">source</a><ahref="#method.eq-7"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &[B; M]) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-7"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-7"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%26%5BB%5D"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1048-1055">source</a><ahref="#impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%26%5BB%5D"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize> PartialEq<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>> for &[B]<spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-3"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1052-1054">source</a><ahref="#method.eq-3"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-3"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-3"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%26%5BB;+M%5D"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1112-1119">source</a><ahref="#impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%26%5BB;+M%5D"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize, const M: usize> PartialEq<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>> for &[B; M]<spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-8"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1116-1118">source</a><ahref="#method.eq-8"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-8"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-8"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%26mut+%5BB%5D"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1068-1075">source</a><ahref="#impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%26mut+%5BB%5D"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize> PartialEq<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>> for &mut [B]<spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-1"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1072-1074">source</a><ahref="#method.eq-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-1"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%5BB%5D"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1028-1035">source</a><ahref="#impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%5BB%5D"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize> PartialEq<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>> for [B]<spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-10"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1032-1034">source</a><ahref="#method.eq-10"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-10"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-10"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%5BB;+M%5D"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1090-1097">source</a><ahref="#impl-PartialEq%3CVec%3CA,+N%3E%3E-for-%5BB;+M%5D"class="anchor">§</a><h3class="code-header">impl<A, B, const N: usize, const M: usize> PartialEq<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>> for [B; M]<spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-5"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1094-1096">source</a><ahref="#method.eq-5"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N>) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-5"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne-5"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CVec%3CB,+N2%3E%3E-for-Vec%3CA,+N1%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1008-1015">source</a><ahref="#impl-PartialEq%3CVec%3CB,+N2%3E%3E-for-Vec%3CA,+N1%3E"class="anchor">§</a><h3class="code-header">impl<A, B, const N1: usize, const N2: usize> PartialEq<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><B, N2>> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><A, N1><spanclass="where fmt-newline">where
A: PartialEq<B>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1012-1014">source</a><ahref="#method.eq"class="anchor">§</a><h4class="code-header">fn <aclass="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><B, N2>) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ne"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ne</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialOrd%3CVec%3CT,+N2%3E%3E-for-Vec%3CT,+N1%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1124-1131">source</a><ahref="#impl-PartialOrd%3CVec%3CT,+N2%3E%3E-for-Vec%3CT,+N1%3E"class="anchor">§</a><h3class="code-header">impl<T, const N1: usize, const N2: usize> PartialOrd<<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N2>> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N1><spanclass="where fmt-newline">where
T: PartialOrd,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.partial_cmp"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1128-1130">source</a><ahref="#method.partial_cmp"class="anchor">§</a><h4class="code-header">fn <aclass="fn">partial_cmp</a>(&self, other: &<aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N2>) -> Option<Ordering></h4></section></summary><divclass='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lt"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.lt"class="anchor">§</a><h4class="code-header">fn <aclass="fn">lt</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.le"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.le"class="anchor">§</a><h4class="code-header">fn <aclass="fn">le</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code>
operator. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.gt"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.gt"class="anchor">§</a><h4class="code-header">fn <aclass="fn">gt</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ge"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.ge"class="anchor">§</a><h4class="code-header">fn <aclass="fn">ge</a>(&self, other: &Rhs) -> bool</h4></section></summary><divclass='docblock'>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code>
operator. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-TryFrom%3C%26'a+%5BT%5D%3E-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#863-869">source</a><ahref="#impl-TryFrom%3C%26'a+%5BT%5D%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<'a, T: Clone, const N: usize> TryFrom<&'a [T]> for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N></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 <aclass="associatedtype">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_from"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#866-868">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <aclass="fn">try_from</a>(slice: &'a [T]) -> Result<Self, Self::Error></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Write-for-Vec%3Cu8,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#845-852">source</a><ahref="#impl-Write-for-Vec%3Cu8,+N%3E"class="anchor">§</a><h3class="code-header">impl<const N: usize> Write for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><u8, N></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.write_str"class="method trait-impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#846-851">source</a><ahref="#method.write_str"class="anchor">§</a><h4class="code-header">fn <aclass="fn">write_str</a>(&mut self, s: &str) -> Result</h4></section></summary><divclass='docblock'>Writes a string slice into this writer, returning whether the write
succeeded. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.write_char"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.1.0">1.1.0</span><ahref="#method.write_char"class="anchor">§</a><h4class="code-header">fn <aclass="fn">write_char</a>(&mut self, c: char) -> Result<(), Error></h4></section></summary><divclass='docblock'>Writes a [<code>char</code>] into this writer, returning whether the write succeeded. <a>Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.write_fmt"class="method trait-impl"><spanclass="since rightside"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.write_fmt"class="anchor">§</a><h4class="code-header">fn <aclass="fn">write_fmt</a>(&mut self, args: Arguments<'_>) -> Result<(), Error></h4></section></summary><divclass='docblock'>Glue for usage of the [<code>write!</code>] macro with implementors of this trait. <a>Read more</a></div></details></div></details><sectionid="impl-Eq-for-Vec%3CT,+N%3E"class="impl"><aclass="src rightside"href="../src/heapless/vec.rs.html#1122">source</a><ahref="#impl-Eq-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, const N: usize> Eq for <aclass="struct"href="struct.Vec.html"title="struct heapless::Vec">Vec</a><T, N><spanclass="where fmt-newline">where
T: UnwindSafe,</span></h3></section></div><h2id="blanket-implementations"class="small-section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor">§</a></h2><divid="blanket-implementations-list"><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Any-for-Vec%3CT,+N%3E"class="impl"><ahref="#impl-Any-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T> Any for T<spanclass="where fmt-newline">where
T: 'static + ?Sized,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl"><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <aclass="fn">type_id</a>(&self) -> TypeId</h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-Vec%3CT,+N%3E"class="impl"><ahref="#impl-Borrow%3CT%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T> Borrow<T> for T<spanclass="where fmt-newline">where
T: ?Sized,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow"class="method trait-impl"><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <aclass="fn">borrow</a>(&self) ->&T</h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-Vec%3CT,+N%3E"class="impl"><ahref="#impl-BorrowMut%3CT%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T> BorrowMut<T> for T<spanclass="where fmt-newline">where
T: ?Sized,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl"><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <aclass="fn">borrow_mut</a>(&mut self) ->&mut T</h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-Vec%3CT,+N%3E"class="impl"><ahref="#impl-From%3CT%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T> From<T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl"><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <aclass="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-Vec%3CT,+N%3E"class="impl"><ahref="#impl-Into%3CU%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, U> Into<U> for T<spanclass="where fmt-newline">where
U: Into<T>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-2"class="associatedtype trait-impl"><ahref="#associatedtype.Error-2"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Error</a> = Infallible</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-1"class="method trait-impl"><ahref="#method.try_from-1"class="anchor">§</a><h4class="code-header">fn <aclass="fn">try_from</a>(value: U) -> Result<T, <T as TryFrom<U>>::Error></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-Vec%3CT,+N%3E"class="impl"><ahref="#impl-TryInto%3CU%3E-for-Vec%3CT,+N%3E"class="anchor">§</a><h3class="code-header">impl<T, U> TryInto<U> for T<spanclass="where fmt-newline">where
U: TryFrom<T>,</span></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 <aclass="associatedtype">Error</a> = <U as TryFrom<T>>::Error</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"><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <aclass="fn">try_into</a>(self) -> Result<U, <U as TryFrom<T>>::Error></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>