329 lines
115 KiB
HTML
329 lines
115 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A zero-copy, byte-aligned vector for variable-width types."><title>VarZeroVec in zerovec - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="zerovec" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">VarZeroVec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../zerovec/index.html">zerovec</a><span class="version">0.11.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">VarZero<wbr>Vec</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#bytes-and-equality" title="Bytes and Equality">Bytes and Equality</a></li><li><a href="#example" title="Example">Example</a></li><li><a href="#how-it-works" title="How it Works">How it Works</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.as_slice" title="as_slice">as_slice</a></li><li><a href="#method.from_bytes_unchecked" title="from_bytes_unchecked">from_bytes_unchecked</a></li><li><a href="#method.is_owned" title="is_owned">is_owned</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.parse_bytes" title="parse_bytes">parse_bytes</a></li></ul><h3><a href="#deref-methods-VarZeroSlice%3CT,+F%3E">Methods from Deref<<wbr>Target=<wbr>VarZero<wbr>Slice<<wbr>T, F>></a></h3><ul class="block deref-methods"><li><a href="#method.as_bytes" title="as_bytes">as_bytes</a></li><li><a href="#method.as_varzerovec" title="as_varzerovec">as_varzerovec</a></li><li><a href="#method.binary_search" title="binary_search">binary_search</a></li><li><a href="#method.binary_search_by" title="binary_search_by">binary_search_by</a></li><li><a href="#method.binary_search_in_range" title="binary_search_in_range">binary_search_in_range</a></li><li><a href="#method.binary_search_in_range_by" title="binary_search_in_range_by">binary_search_in_range_by</a></li><li><a href="#method.get" title="get">get</a></li><li><a href="#method.get_unchecked" title="get_unchecked">get_unchecked</a></li><li><a href="#method.is_empty" title="is_empty">is_empty</a></li><li><a href="#method.iter" title="iter">iter</a></li><li><a href="#method.len" title="len">len</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-VarZeroVec%3C'a,+T,+F%3E" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-VarZeroVec%3C'_,+T,+F%3E" title="Debug">Debug</a></li><li><a href="#impl-Default-for-VarZeroVec%3C'_,+T,+F%3E" title="Default">Default</a></li><li><a href="#impl-Deref-for-VarZeroVec%3C'_,+T,+F%3E" title="Deref">Deref</a></li><li><a href="#impl-EncodeAsVarULE%3CVarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'_,+T,+F%3E" title="EncodeAsVarULE<VarZeroSlice<T, F>>">EncodeAsVarULE<VarZeroSlice<T, F>></a></li><li><a href="#impl-Eq-for-VarZeroVec%3C'a,+T,+F%3E" title="Eq">Eq</a></li><li><a href="#impl-From%3C%26VarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'a,+T,+F%3E" title="From<&'a VarZeroSlice<T, F>>">From<&'a VarZeroSlice<T, F>></a></li><li><a href="#impl-Ord-for-VarZeroVec%3C'a,+T,+F%3E" title="Ord">Ord</a></li><li><a href="#impl-PartialEq%3C%26%5BA%5D%3E-for-VarZeroVec%3C'_,+T,+F%3E" title="PartialEq<&[A]>">PartialEq<&[A]></a></li><li><a href="#impl-PartialEq%3CVarZeroVec%3C'b,+T,+F%3E%3E-for-VarZeroVec%3C'a,+T,+F%3E" title="PartialEq<VarZeroVec<'b, T, F>>">PartialEq<VarZeroVec<'b, T, F>></a></li><li><a href="#impl-PartialEq%3C%5BA;+N%5D%3E-for-VarZeroVec%3C'_,+T,+F%3E" title="PartialEq<[A; N]>">PartialEq<[A; N]></a></li><li><a href="#impl-PartialOrd-for-VarZeroVec%3C'a,+T,+F%3E" title="PartialOrd">PartialOrd</a></li><li><a href="#impl-Yokeable%3C'a%3E-for-VarZeroVec%3C'static,+T%3E" title="Yokeable<'a>">Yokeable<'a></a></li><li><a href="#impl-ZeroFrom%3C'zf,+VarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'zf,+T,+F%3E" title="ZeroFrom<'zf, VarZeroSlice<T, F>>">ZeroFrom<'zf, VarZeroSlice<T, F>></a></li><li><a href="#impl-ZeroFrom%3C'zf,+VarZeroVec%3C'_,+T,+F%3E%3E-for-VarZeroVec%3C'zf,+T,+F%3E" title="ZeroFrom<'zf, VarZeroVec<'_, T, F>>">ZeroFrom<'zf, VarZeroVec<'_, T, F>></a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-VarZeroVec%3C'a,+T,+F%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-VarZeroVec%3C'a,+T,+F%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-VarZeroVec%3C'a,+T,+F%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-VarZeroVec%3C'a,+T,+F%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-VarZeroVec%3C'a,+T,+F%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-VarZeroVec%3C'a,+T,+F%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-Receiver-for-P" title="Receiver">Receiver</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate zerovec</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">zerovec</a></div><h1>Struct <span class="struct">VarZero<wbr>Vec</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/zerovec/varzerovec/vec.rs.html#141">Source</a> </span></div><pre class="rust item-decl"><code>pub struct VarZeroVec<'a, T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F = <a class="struct" href="vecs/struct.Index16.html" title="struct zerovec::vecs::Index16">Index16</a>>(<span class="comment">/* private fields */</span>);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A zero-copy, byte-aligned vector for variable-width types.</p>
|
||
<p><code>VarZeroVec<T></code> is designed as a drop-in replacement for <code>Vec<T></code> in situations where it is
|
||
desirable to borrow data from an unaligned byte slice, such as zero-copy deserialization, and
|
||
where <code>T</code>’s data is variable-length (e.g. <code>String</code>)</p>
|
||
<p><code>T</code> must implement <a href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE"><code>VarULE</code></a>, which is already implemented for <a href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html" title="primitive str"><code>str</code></a> and <code>[u8]</code>. For storing more
|
||
complicated series of elements, it is implemented on <code>ZeroSlice<T></code> as well as <code>VarZeroSlice<T></code>
|
||
for nesting. <a href="attr.make_varule.html" title="attr zerovec::make_varule"><code>zerovec::make_varule</code></a> may be used to generate
|
||
a dynamically-sized <a href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE"><code>VarULE</code></a> type and conversions to and from a custom type.</p>
|
||
<p>For example, here are some owned types and their zero-copy equivalents:</p>
|
||
<ul>
|
||
<li><code>Vec<String></code>: <code>VarZeroVec<'a, str></code></li>
|
||
<li><code>Vec<Vec<u8>>></code>: <code>VarZeroVec<'a, [u8]></code></li>
|
||
<li><code>Vec<Vec<u32>></code>: <code>VarZeroVec<'a, ZeroSlice<u32>></code></li>
|
||
<li><code>Vec<Vec<String>></code>: <code>VarZeroVec<'a, VarZeroSlice<str>></code></li>
|
||
</ul>
|
||
<p>Most of the methods on <code>VarZeroVec<'a, T></code> come from its <a href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref"><code>Deref</code></a> implementation to <a href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice"><code>VarZeroSlice<T></code></a>.</p>
|
||
<p>For creating zero-copy vectors of fixed-size types, see <a href="struct.ZeroVec.html" title="struct zerovec::ZeroVec"><code>ZeroVec</code></a>.</p>
|
||
<p><code>VarZeroVec<T></code> behaves much like <a href="alloc::borrow::Cow"><code>Cow</code></a>, where it can be constructed from
|
||
owned data (and then mutated!) but can also borrow from some buffer.</p>
|
||
<p>The <code>F</code> type parameter is a <a href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat"><code>VarZeroVecFormat</code></a> (see its docs for more details), which can be used to select the
|
||
precise format of the backing buffer with various size and performance tradeoffs. It defaults to <a href="vecs/struct.Index16.html" title="struct zerovec::vecs::Index16"><code>Index16</code></a>.</p>
|
||
<h2 id="bytes-and-equality"><a class="doc-anchor" href="#bytes-and-equality">§</a>Bytes and Equality</h2>
|
||
<p>Two <a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec</code></a>s are equal if and only if their bytes are equal, as described in the trait
|
||
<a href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE"><code>VarULE</code></a>. However, we do not guarantee stability of byte equality or serialization format
|
||
across major SemVer releases.</p>
|
||
<p>To compare a <a href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec"><code>Vec<T></code></a> to a <a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec<T></code></a>, it is generally recommended to use
|
||
<a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#method.eq" title="method core::iter::traits::iterator::Iterator::eq"><code>Iterator::eq</code></a>, since it is somewhat expensive at runtime to convert from a <a href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec"><code>Vec<T></code></a> to a
|
||
<a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec<T></code></a> or vice-versa.</p>
|
||
<p>Prior to zerovec reaching 1.0, the precise byte representation of <a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec</code></a> is still
|
||
under consideration, with different options along the space-time spectrum. See
|
||
<a href="https://github.com/unicode-org/icu4x/issues/1410">#1410</a>.</p>
|
||
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerovec::VarZeroVec;
|
||
|
||
<span class="comment">// The little-endian bytes correspond to the list of strings.
|
||
</span><span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"w"</span>, <span class="string">"ω"</span>, <span class="string">"文"</span>, <span class="string">"𑄃"</span>];
|
||
|
||
<span class="attr">#[derive(serde::Serialize, serde::Deserialize)]
|
||
</span><span class="kw">struct </span>Data<<span class="lifetime">'a</span>> {
|
||
<span class="attr">#[serde(borrow)]
|
||
</span>strings: VarZeroVec<<span class="lifetime">'a</span>, str>,
|
||
}
|
||
|
||
<span class="kw">let </span>data = Data {
|
||
strings: VarZeroVec::from(<span class="kw-2">&</span>strings),
|
||
};
|
||
|
||
<span class="kw">let </span>bincode_bytes =
|
||
bincode::serialize(<span class="kw-2">&</span>data).expect(<span class="string">"Serialization should be successful"</span>);
|
||
|
||
<span class="comment">// Will deserialize without allocations
|
||
</span><span class="kw">let </span>deserialized: Data = bincode::deserialize(<span class="kw-2">&</span>bincode_bytes)
|
||
.expect(<span class="string">"Deserialization should be successful"</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(deserialized.strings.get(<span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="string">"文"</span>));
|
||
<span class="macro">assert_eq!</span>(deserialized.strings, <span class="kw-2">&*</span>strings);</code></pre></div>
|
||
<p>Here’s another example with <code>ZeroSlice<T></code> (similar to <code>[T]</code>):</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerovec::VarZeroVec;
|
||
<span class="kw">use </span>zerovec::ZeroSlice;
|
||
|
||
<span class="comment">// The structured list correspond to the list of integers.
|
||
</span><span class="kw">let </span>numbers: <span class="kw-2">&</span>[<span class="kw-2">&</span>[u32]] = <span class="kw-2">&</span>[
|
||
<span class="kw-2">&</span>[<span class="number">12</span>, <span class="number">25</span>, <span class="number">38</span>],
|
||
<span class="kw-2">&</span>[<span class="number">39179</span>, <span class="number">100</span>],
|
||
<span class="kw-2">&</span>[<span class="number">42</span>, <span class="number">55555</span>],
|
||
<span class="kw-2">&</span>[<span class="number">12345</span>, <span class="number">54321</span>, <span class="number">9</span>],
|
||
];
|
||
|
||
<span class="attr">#[derive(serde::Serialize, serde::Deserialize)]
|
||
</span><span class="kw">struct </span>Data<<span class="lifetime">'a</span>> {
|
||
<span class="attr">#[serde(borrow)]
|
||
</span>vecs: VarZeroVec<<span class="lifetime">'a</span>, ZeroSlice<u32>>,
|
||
}
|
||
|
||
<span class="kw">let </span>data = Data {
|
||
vecs: VarZeroVec::from(numbers),
|
||
};
|
||
|
||
<span class="kw">let </span>bincode_bytes =
|
||
bincode::serialize(<span class="kw-2">&</span>data).expect(<span class="string">"Serialization should be successful"</span>);
|
||
|
||
<span class="kw">let </span>deserialized: Data = bincode::deserialize(<span class="kw-2">&</span>bincode_bytes)
|
||
.expect(<span class="string">"Deserialization should be successful"</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(deserialized.vecs[<span class="number">0</span>].get(<span class="number">1</span>).unwrap(), <span class="number">25</span>);
|
||
<span class="macro">assert_eq!</span>(deserialized.vecs[<span class="number">1</span>], <span class="kw-2">*</span>numbers[<span class="number">1</span>]);</code></pre></div>
|
||
<p><a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec</code></a>s can be nested infinitely via a similar mechanism, see the docs of <a href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice"><code>VarZeroSlice</code></a>
|
||
for more information.</p>
|
||
<h2 id="how-it-works"><a class="doc-anchor" href="#how-it-works">§</a>How it Works</h2>
|
||
<p><code>VarZeroVec<T></code>, when used with non-human-readable serializers (like <code>bincode</code>), will
|
||
serialize to a specially formatted list of bytes. The format is:</p>
|
||
<ul>
|
||
<li>2 bytes for <code>length</code> (interpreted as a little-endian u16)</li>
|
||
<li><code>2 * (length - 1)</code> bytes of <code>indices</code> (interpreted as little-endian u16s)</li>
|
||
<li>Remaining bytes for actual <code>data</code></li>
|
||
</ul>
|
||
<p>The format is tweakable by setting the <code>F</code> parameter, by default it uses u16 indices and lengths but other
|
||
<code>VarZeroVecFormat</code> types can set other sizes.</p>
|
||
<p>Each element in the <code>indices</code> array points to the ending index of its corresponding
|
||
data part in the <code>data</code> list. The starting index can be calculated from the ending index
|
||
of the next element (or 0 for the first element). The last ending index, not stored in the array, is
|
||
the length of the <code>data</code> segment.</p>
|
||
<p>See <a href="https://github.com/unicode-org/icu4x/blob/main/utils/zerovec/design_doc.md">the design doc</a> for more details.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#209-375">Source</a><a href="#impl-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#221-223">Source</a><h4 class="code-header">pub const fn <a href="#method.new" class="fn">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Creates a new, empty <code>VarZeroVec<T></code>.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>zerovec::VarZeroVec;
|
||
|
||
<span class="kw">let </span>vzv: VarZeroVec<str> = VarZeroVec::new();
|
||
<span class="macro">assert!</span>(vzv.is_empty());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.parse_bytes" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#242-246">Source</a><h4 class="code-header">pub fn <a href="#method.parse_bytes" class="fn">parse_bytes</a>(slice: &'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="ule/enum.UleError.html" title="enum zerovec::ule::UleError">UleError</a>></h4></section></summary><div class="docblock"><p>Parse a VarZeroVec from a slice of the appropriate format</p>
|
||
<p>Slices of the right format can be obtained via <a href="struct.VarZeroSlice.html#method.as_bytes" title="method zerovec::VarZeroSlice::as_bytes"><code>VarZeroSlice::as_bytes()</code></a>.</p>
|
||
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>, <span class="string">"quux"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>vec[<span class="number">0</span>], <span class="string">"foo"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>vec[<span class="number">1</span>], <span class="string">"bar"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>vec[<span class="number">2</span>], <span class="string">"baz"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>vec[<span class="number">3</span>], <span class="string">"quux"</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.from_bytes_unchecked" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#253-258">Source</a><h4 class="code-header">pub const unsafe fn <a href="#method.from_bytes_unchecked" class="fn">from_bytes_unchecked</a>(bytes: &'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> Self</h4></section></summary><div class="docblock"><p>Uses a <code>&[u8]</code> buffer as a <code>VarZeroVec<T></code> without any verification.</p>
|
||
<h5 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h5>
|
||
<p><code>bytes</code> need to be an output from <a href="struct.VarZeroSlice.html#method.as_bytes" title="method zerovec::VarZeroSlice::as_bytes"><code>VarZeroSlice::as_bytes()</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_slice" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#323-329">Source</a><h4 class="code-header">pub fn <a href="#method.as_slice" class="fn">as_slice</a>(&self) -> &<a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F></h4></section></summary><div class="docblock"><p>Obtain this <code>VarZeroVec</code> as a <a href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice"><code>VarZeroSlice</code></a></p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_owned" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#363-369">Source</a><h4 class="code-header">pub fn <a href="#method.is_owned" class="fn">is_owned</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether the <a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec</code></a> is operating on owned or borrowed
|
||
data. [<code>VarZeroVec::into_owned()</code>] and [<code>VarZeroVec::make_mut()</code>] can
|
||
be used to force it into an owned type</p>
|
||
</div></details></div></details></div><details class="toggle big-toggle" open><summary><h2 id="deref-methods-VarZeroSlice%3CT,+F%3E" class="section-header"><span>Methods from <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F>></span><a href="#deref-methods-VarZeroSlice%3CT,+F%3E" class="anchor">§</a></h2></summary><div id="deref-methods-VarZeroSlice%3CT,+F%3E-1" class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#144-146">Source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the number of elements in this slice</p>
|
||
<h5 id="example-2"><a class="doc-anchor" href="#example-2">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>, <span class="string">"quux"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="macro">assert_eq!</span>(vec.len(), <span class="number">4</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#160-162">Source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the slice contains no elements.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings: Vec<String> = <span class="macro">vec!</span>[];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="macro">assert!</span>(vec.is_empty());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.iter" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#180-182">Source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fn">iter</a><'b>(&'b self) -> <a class="struct" href="vecs/struct.VarZeroSliceIter.html" title="struct zerovec::vecs::VarZeroSliceIter">VarZeroSliceIter</a><'b, T, F> <a href="#" class="tooltip" data-notable-ty="VarZeroSliceIter<'b, T, F>">ⓘ</a></h4></section></summary><div class="docblock"><p>Obtain an iterator over this slice’s elements</p>
|
||
<h5 id="example-3"><a class="doc-anchor" href="#example-3">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>, <span class="string">"quux"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>iter_results: Vec<<span class="kw-2">&</span>str> = vec.iter().collect();
|
||
<span class="macro">assert_eq!</span>(iter_results[<span class="number">0</span>], <span class="string">"foo"</span>);
|
||
<span class="macro">assert_eq!</span>(iter_results[<span class="number">1</span>], <span class="string">"bar"</span>);
|
||
<span class="macro">assert_eq!</span>(iter_results[<span class="number">2</span>], <span class="string">"baz"</span>);
|
||
<span class="macro">assert_eq!</span>(iter_results[<span class="number">3</span>], <span class="string">"quux"</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.get" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#201-203">Source</a><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a>(&self, idx: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a>></h4></section></summary><div class="docblock"><p>Get one of this slice’s elements, returning <code>None</code> if the index is out of bounds</p>
|
||
<h5 id="example-4"><a class="doc-anchor" href="#example-4">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>, <span class="string">"quux"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>iter_results: Vec<<span class="kw-2">&</span>str> = vec.iter().collect();
|
||
<span class="macro">assert_eq!</span>(vec.get(<span class="number">0</span>), <span class="prelude-val">Some</span>(<span class="string">"foo"</span>));
|
||
<span class="macro">assert_eq!</span>(vec.get(<span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="string">"bar"</span>));
|
||
<span class="macro">assert_eq!</span>(vec.get(<span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="string">"baz"</span>));
|
||
<span class="macro">assert_eq!</span>(vec.get(<span class="number">3</span>), <span class="prelude-val">Some</span>(<span class="string">"quux"</span>));
|
||
<span class="macro">assert_eq!</span>(vec.get(<span class="number">4</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.get_unchecked" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#227-229">Source</a><h4 class="code-header">pub unsafe fn <a href="#method.get_unchecked" class="fn">get_unchecked</a>(&self, idx: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a></h4></section></summary><div class="docblock"><p>Get one of this slice’s elements</p>
|
||
<h5 id="safety-1"><a class="doc-anchor" href="#safety-1">§</a>Safety</h5>
|
||
<p><code>index</code> must be in range</p>
|
||
<h5 id="example-5"><a class="doc-anchor" href="#example-5">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>, <span class="string">"quux"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>iter_results: Vec<<span class="kw-2">&</span>str> = vec.iter().collect();
|
||
<span class="kw">unsafe </span>{
|
||
<span class="macro">assert_eq!</span>(vec.get_unchecked(<span class="number">0</span>), <span class="string">"foo"</span>);
|
||
<span class="macro">assert_eq!</span>(vec.get_unchecked(<span class="number">1</span>), <span class="string">"bar"</span>);
|
||
<span class="macro">assert_eq!</span>(vec.get_unchecked(<span class="number">2</span>), <span class="string">"baz"</span>);
|
||
<span class="macro">assert_eq!</span>(vec.get_unchecked(<span class="number">3</span>), <span class="string">"quux"</span>);
|
||
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.as_bytes" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#256-258">Source</a><h4 class="code-header">pub fn <a href="#method.as_bytes" class="fn">as_bytes</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Get a reference to the entire encoded backing buffer of this slice</p>
|
||
<p>The bytes can be passed back to <a href="struct.VarZeroSlice.html#method.parse_bytes" title="associated function zerovec::VarZeroSlice::parse_bytes"><code>Self::parse_bytes()</code></a>.</p>
|
||
<p>To take the bytes as a vector, see [<code>VarZeroVec::into_bytes()</code>].</p>
|
||
<h5 id="example-6"><a class="doc-anchor" href="#example-6">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>];
|
||
<span class="kw">let </span>vzv = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="macro">assert_eq!</span>(vzv, VarZeroVec::parse_bytes(vzv.as_bytes()).unwrap());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.as_varzerovec" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#264-266">Source</a><h4 class="code-header">pub fn <a href="#method.as_varzerovec" class="fn">as_varzerovec</a><'a>(&'a self) -> <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F></h4></section></summary><div class="docblock"><p>Get this <a href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice"><code>VarZeroSlice</code></a> as a borrowed <a href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec"><code>VarZeroVec</code></a></p>
|
||
<p>If you wish to repeatedly call methods on this <a href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice"><code>VarZeroSlice</code></a>,
|
||
it is more efficient to perform this conversion first</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#300-302">Source</a><h4 class="code-header">pub fn <a href="#method.binary_search" class="fn">binary_search</a>(&self, x: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class="docblock"><p>Binary searches a sorted <code>VarZeroVec<T></code> for the given element. For more information, see
|
||
the standard library function <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.binary_search"><code>binary_search</code></a>.</p>
|
||
<h5 id="example-7"><a class="doc-anchor" href="#example-7">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"f"</span>, <span class="string">"g"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="macro">assert_eq!</span>(vec.binary_search(<span class="string">"f"</span>), <span class="prelude-val">Ok</span>(<span class="number">2</span>));
|
||
<span class="macro">assert_eq!</span>(vec.binary_search(<span class="string">"e"</span>), <span class="prelude-val">Err</span>(<span class="number">2</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_in_range" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#337-343">Source</a><h4 class="code-header">pub fn <a href="#method.binary_search_in_range" class="fn">binary_search_in_range</a>(
|
||
&self,
|
||
x: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a>,
|
||
range: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>>></h4></section></summary><div class="docblock"><p>Binary searches a <code>VarZeroVec<T></code> for the given element within a certain sorted range.</p>
|
||
<p>If the range is out of bounds, returns <code>None</code>. Otherwise, returns a <code>Result</code> according
|
||
to the behavior of the standard library function <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.binary_search"><code>binary_search</code></a>.</p>
|
||
<p>The index is returned relative to the start of the range.</p>
|
||
<h5 id="example-8"><a class="doc-anchor" href="#example-8">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"f"</span>, <span class="string">"g"</span>, <span class="string">"m"</span>, <span class="string">"n"</span>, <span class="string">"q"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="comment">// Same behavior as binary_search when the range covers the whole slice:
|
||
</span><span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"g"</span>, <span class="number">0</span>..<span class="number">7</span>), <span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(<span class="number">3</span>)));
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"h"</span>, <span class="number">0</span>..<span class="number">7</span>), <span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">4</span>)));
|
||
|
||
<span class="comment">// Will not look outside of the range:
|
||
</span><span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"g"</span>, <span class="number">0</span>..<span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">1</span>)));
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"g"</span>, <span class="number">6</span>..<span class="number">7</span>), <span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">0</span>)));
|
||
|
||
<span class="comment">// Will return indices relative to the start of the range:
|
||
</span><span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"g"</span>, <span class="number">1</span>..<span class="number">6</span>), <span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(<span class="number">2</span>)));
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"h"</span>, <span class="number">1</span>..<span class="number">6</span>), <span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">3</span>)));
|
||
|
||
<span class="comment">// Will return `None` if the range is out of bounds:
|
||
</span><span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"x"</span>, <span class="number">100</span>..<span class="number">200</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_in_range(<span class="string">"x"</span>, <span class="number">0</span>..<span class="number">200</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_by" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#368-370">Source</a><h4 class="code-header">pub fn <a href="#method.binary_search_by" class="fn">binary_search_by</a>(
|
||
&self,
|
||
predicate: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class="docblock"><p>Binary searches a sorted <code>VarZeroVec<T></code> for the given predicate. For more information, see
|
||
the standard library function <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.binary_search_by"><code>binary_search_by</code></a>.</p>
|
||
<h5 id="example-9"><a class="doc-anchor" href="#example-9">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"f"</span>, <span class="string">"g"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_by(|probe| probe.cmp(<span class="string">"f"</span>)), <span class="prelude-val">Ok</span>(<span class="number">2</span>));
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_by(|probe| probe.cmp(<span class="string">"e"</span>)), <span class="prelude-val">Err</span>(<span class="number">2</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_in_range_by" class="method"><a class="src rightside" href="../src/zerovec/varzerovec/slice.rs.html#425-432">Source</a><h4 class="code-header">pub fn <a href="#method.binary_search_in_range_by" class="fn">binary_search_in_range_by</a>(
|
||
&self,
|
||
predicate: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,
|
||
range: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>>></h4></section></summary><div class="docblock"><p>Binary searches a <code>VarZeroVec<T></code> for the given predicate within a certain sorted range.</p>
|
||
<p>If the range is out of bounds, returns <code>None</code>. Otherwise, returns a <code>Result</code> according
|
||
to the behavior of the standard library function <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.binary_search"><code>binary_search</code></a>.</p>
|
||
<p>The index is returned relative to the start of the range.</p>
|
||
<h5 id="example-10"><a class="doc-anchor" href="#example-10">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>strings = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"f"</span>, <span class="string">"g"</span>, <span class="string">"m"</span>, <span class="string">"n"</span>, <span class="string">"q"</span>];
|
||
<span class="kw">let </span>vec = VarZeroVec::<str>::from(<span class="kw-2">&</span>strings);
|
||
|
||
<span class="comment">// Same behavior as binary_search when the range covers the whole slice:
|
||
</span><span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"g"</span>), <span class="number">0</span>..<span class="number">7</span>),
|
||
<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(<span class="number">3</span>))
|
||
);
|
||
<span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"h"</span>), <span class="number">0</span>..<span class="number">7</span>),
|
||
<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">4</span>))
|
||
);
|
||
|
||
<span class="comment">// Will not look outside of the range:
|
||
</span><span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"g"</span>), <span class="number">0</span>..<span class="number">1</span>),
|
||
<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">1</span>))
|
||
);
|
||
<span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"g"</span>), <span class="number">6</span>..<span class="number">7</span>),
|
||
<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">0</span>))
|
||
);
|
||
|
||
<span class="comment">// Will return indices relative to the start of the range:
|
||
</span><span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"g"</span>), <span class="number">1</span>..<span class="number">6</span>),
|
||
<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(<span class="number">2</span>))
|
||
);
|
||
<span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"h"</span>), <span class="number">1</span>..<span class="number">6</span>),
|
||
<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="number">3</span>))
|
||
);
|
||
|
||
<span class="comment">// Will return `None` if the range is out of bounds:
|
||
</span><span class="macro">assert_eq!</span>(
|
||
vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"x"</span>), <span class="number">100</span>..<span class="number">200</span>),
|
||
<span class="prelude-val">None
|
||
</span>);
|
||
<span class="macro">assert_eq!</span>(vec.binary_search_in_range_by(|v| v.cmp(<span class="string">"x"</span>), <span class="number">0</span>..<span class="number">200</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#149-157">Source</a><a href="#impl-Clone-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#150-156">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> Self</h4></section></summary><div class='docblock'>Returns a duplicate of the value. <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/clone.rs.html#245-247">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-VarZeroVec%3C'_,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#159-166">Source</a><a href="#impl-Debug-for-VarZeroVec%3C'_,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<T, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F><div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#163-165">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.93.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-VarZeroVec%3C'_,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#195-200">Source</a><a href="#impl-Default-for-VarZeroVec%3C'_,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#197-199">Source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-VarZeroVec%3C'_,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#202-207">Source</a><a href="#impl-Deref-for-VarZeroVec%3C'_,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#203">Source</a><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F></h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#204-206">Source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&self) -> &<a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-EncodeAsVarULE%3CVarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'_,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/ule/encode.rs.html#289-309">Source</a><a href="#impl-EncodeAsVarULE%3CVarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'_,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<T, F> <a class="trait" href="ule/trait.EncodeAsVarULE.html" title="trait zerovec::ule::EncodeAsVarULE">EncodeAsVarULE</a><<a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F><div class="where">where
|
||
T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.encode_var_ule_as_slices" class="method trait-impl"><a class="src rightside" href="../src/zerovec/ule/encode.rs.html#294-297">Source</a><a href="#method.encode_var_ule_as_slices" class="anchor">§</a><h4 class="code-header">fn <a href="ule/trait.EncodeAsVarULE.html#tymethod.encode_var_ule_as_slices" class="fn">encode_var_ule_as_slices</a><R>(&self, _: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&[&[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]]) -> R) -> R</h4></section></summary><div class='docblock'>Calls <code>cb</code> with a piecewise list of byte slices that when concatenated
|
||
produce the memory pattern of the corresponding instance of <code>T</code>. <a href="ule/trait.EncodeAsVarULE.html#tymethod.encode_var_ule_as_slices">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.encode_var_ule_len" class="method trait-impl"><a class="src rightside" href="../src/zerovec/ule/encode.rs.html#300-302">Source</a><a href="#method.encode_var_ule_len" class="anchor">§</a><h4 class="code-header">fn <a href="ule/trait.EncodeAsVarULE.html#method.encode_var_ule_len" class="fn">encode_var_ule_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Return the length, in bytes, of the corresponding <a href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE"><code>VarULE</code></a> type</div></details><details class="toggle method-toggle" open><summary><section id="method.encode_var_ule_write" class="method trait-impl"><a class="src rightside" href="../src/zerovec/ule/encode.rs.html#305-308">Source</a><a href="#method.encode_var_ule_write" class="anchor">§</a><h4 class="code-header">fn <a href="ule/trait.EncodeAsVarULE.html#method.encode_var_ule_write" class="fn">encode_var_ule_write</a>(&self, dst: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>])</h4></section></summary><div class='docblock'>Write the corresponding <a href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE"><code>VarULE</code></a> type to the <code>dst</code> buffer. <code>dst</code> should
|
||
be the size of <a href="ule/trait.EncodeAsVarULE.html#method.encode_var_ule_len"><code>Self::encode_var_ule_len()</code></a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%26VarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#176-180">Source</a><a href="#impl-From%3C%26VarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><&'a <a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#177-179">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(other: &'a <a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#483-487">Source</a><a href="#impl-Ord-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#484-486">Source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&self, other: &Self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1021-1023">Source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1060-1062">Source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1086-1088">Source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26%5BA%5D%3E-for-VarZeroVec%3C'_,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#451-462">Source</a><a href="#impl-PartialEq%3C%26%5BA%5D%3E-for-VarZeroVec%3C'_,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<T, A, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><&<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.slice.html">[A]</a>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F><div class="where">where
|
||
T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,
|
||
A: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><T>,
|
||
F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-1" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#459-461">Source</a><a href="#method.eq-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &&<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.slice.html">[A]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#264">Source</a></span><a href="#method.ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%5BA;+N%5D%3E-for-VarZeroVec%3C'_,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#464-475">Source</a><a href="#impl-PartialEq%3C%5BA;+N%5D%3E-for-VarZeroVec%3C'_,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<T, A, F, const N: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.array.html">[A; N]</a>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F><div class="where">where
|
||
T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,
|
||
A: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><T>,
|
||
F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-2" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#472-474">Source</a><a href="#method.eq-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.array.html">[A; N]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#264">Source</a></span><a href="#method.ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CVarZeroVec%3C'b,+T,+F%3E%3E-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#421-440">Source</a><a href="#impl-PartialEq%3CVarZeroVec%3C'b,+T,+F%3E%3E-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'b, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'b, T, F>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>,
|
||
F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#429-439">Source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'b, T, F>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#264">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#477-481">Source</a><a href="#impl-PartialOrd-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#478-480">Source</a><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&self, other: &Self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1398">Source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1416">Source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
|
||
<code><=</code> operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1434">Source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code>
|
||
operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1452">Source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
|
||
the <code>>=</code> operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Yokeable%3C'a%3E-for-VarZeroVec%3C'static,+T%3E" class="impl"><a class="src rightside" href="../src/zerovec/yoke_impls.rs.html#55-79">Source</a><a href="#impl-Yokeable%3C'a%3E-for-VarZeroVec%3C'static,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T: 'static + <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../yoke/yokeable/trait.Yokeable.html" title="trait yoke::yokeable::Yokeable">Yokeable</a><'a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'static, T></h3><div class="docblock"><p>This impl requires enabling the optional <code>yoke</code> Cargo feature of the <code>zerovec</code> crate</p>
|
||
</div></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../src/zerovec/yoke_impls.rs.html#56">Source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="../yoke/yokeable/trait.Yokeable.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T></h4></section></summary><div class='docblock'>This type MUST be <code>Self</code> with the <code>'static</code> replaced with <code>'a</code>, i.e. <code>Self<'a></code></div></details><details class="toggle method-toggle" open><summary><section id="method.transform" class="method trait-impl"><a class="src rightside" href="../src/zerovec/yoke_impls.rs.html#58-60">Source</a><a href="#method.transform" class="anchor">§</a><h4 class="code-header">fn <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.transform" class="fn">transform</a>(&'a self) -> &'a Self::<a class="associatedtype" href="../yoke/yokeable/trait.Yokeable.html#associatedtype.Output" title="type yoke::yokeable::Yokeable::Output">Output</a></h4></section></summary><div class='docblock'>This method must cast <code>self</code> between <code>&'a Self<'static></code> and <code>&'a Self<'a></code>. <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.transform">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.transform_owned" class="method trait-impl"><a class="src rightside" href="../src/zerovec/yoke_impls.rs.html#62-64">Source</a><a href="#method.transform_owned" class="anchor">§</a><h4 class="code-header">fn <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.transform_owned" class="fn">transform_owned</a>(self) -> Self::<a class="associatedtype" href="../yoke/yokeable/trait.Yokeable.html#associatedtype.Output" title="type yoke::yokeable::Yokeable::Output">Output</a></h4></section></summary><div class='docblock'>This method must cast <code>self</code> between <code>Self<'static></code> and <code>Self<'a></code>. <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.transform_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.make" class="method trait-impl"><a class="src rightside" href="../src/zerovec/yoke_impls.rs.html#66-71">Source</a><a href="#method.make" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.make" class="fn">make</a>(from: Self::<a class="associatedtype" href="../yoke/yokeable/trait.Yokeable.html#associatedtype.Output" title="type yoke::yokeable::Yokeable::Output">Output</a>) -> Self</h4></section></summary><div class='docblock'>This method can be used to cast away <code>Self<'a></code>’s lifetime. <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.make">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.transform_mut" class="method trait-impl"><a class="src rightside" href="../src/zerovec/yoke_impls.rs.html#73-78">Source</a><a href="#method.transform_mut" class="anchor">§</a><h4 class="code-header">fn <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.transform_mut" class="fn">transform_mut</a><F>(&'a mut self, f: F)<div class="where">where
|
||
F: 'static + for<'b> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&'b mut Self::<a class="associatedtype" href="../yoke/yokeable/trait.Yokeable.html#associatedtype.Output" title="type yoke::yokeable::Yokeable::Output">Output</a>),</div></h4></section></summary><div class='docblock'>This method must cast <code>self</code> between <code>&'a mut Self<'static></code> and <code>&'a mut Self<'a></code>,
|
||
and pass it to <code>f</code>. <a href="../yoke/yokeable/trait.Yokeable.html#tymethod.transform_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-ZeroFrom%3C'zf,+VarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'zf,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/zerofrom_impls.rs.html#44-52">Source</a><a href="#impl-ZeroFrom%3C'zf,+VarZeroSlice%3CT,+F%3E%3E-for-VarZeroVec%3C'zf,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'zf, T, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="../zerofrom/zero_from/trait.ZeroFrom.html" title="trait zerofrom::zero_from::ZeroFrom">ZeroFrom</a><'zf, <a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'zf, T, F><div class="where">where
|
||
T: 'static + <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.zero_from" class="method trait-impl"><a class="src rightside" href="../src/zerovec/zerofrom_impls.rs.html#49-51">Source</a><a href="#method.zero_from" class="anchor">§</a><h4 class="code-header">fn <a href="../zerofrom/zero_from/trait.ZeroFrom.html#tymethod.zero_from" class="fn">zero_from</a>(other: &'zf <a class="struct" href="struct.VarZeroSlice.html" title="struct zerovec::VarZeroSlice">VarZeroSlice</a><T, F>) -> Self</h4></section></summary><div class='docblock'>Clone the other <code>C</code> into a struct that may retain references into <code>C</code>.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-ZeroFrom%3C'zf,+VarZeroVec%3C'_,+T,+F%3E%3E-for-VarZeroVec%3C'zf,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/zerofrom_impls.rs.html#54-62">Source</a><a href="#impl-ZeroFrom%3C'zf,+VarZeroVec%3C'_,+T,+F%3E%3E-for-VarZeroVec%3C'zf,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'zf, T, F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>> <a class="trait" href="../zerofrom/zero_from/trait.ZeroFrom.html" title="trait zerofrom::zero_from::ZeroFrom">ZeroFrom</a><'zf, <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F>> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'zf, T, F><div class="where">where
|
||
T: 'static + <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.zero_from-1" class="method trait-impl"><a class="src rightside" href="../src/zerovec/zerofrom_impls.rs.html#59-61">Source</a><a href="#method.zero_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="../zerofrom/zero_from/trait.ZeroFrom.html#tymethod.zero_from" class="fn">zero_from</a>(other: &'zf <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'_, T, F>) -> Self</h4></section></summary><div class='docblock'>Clone the other <code>C</code> into a struct that may retain references into <code>C</code>.</div></details></div></details><section id="impl-Eq-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a class="src rightside" href="../src/zerovec/varzerovec/vec.rs.html#442-449">Source</a><a href="#impl-Eq-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
T: <a class="trait" href="ule/trait.VarULE.html" title="trait zerovec::ule::VarULE">VarULE</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,
|
||
F: <a class="trait" href="vecs/trait.VarZeroVecFormat.html" title="trait zerovec::vecs::VarZeroVecFormat">VarZeroVecFormat</a>,</div></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a href="#impl-Freeze-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-RefUnwindSafe-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a href="#impl-RefUnwindSafe-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Send-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a href="#impl-Send-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Sync-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a href="#impl-Sync-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Unpin-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a href="#impl-Unpin-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-UnwindSafe-for-VarZeroVec%3C'a,+T,+F%3E" class="impl"><a href="#impl-UnwindSafe-for-VarZeroVec%3C'a,+T,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, F> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.VarZeroVec.html" title="struct zerovec::VarZeroVec">VarZeroVec</a><'a, T, F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/clone.rs.html#547">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/clone.rs.html#549">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dest: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dest</code>. <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#767-769">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Receiver-for-P" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/ops/deref.rs.html#378-380">Source</a><a href="#impl-Receiver-for-P" class="anchor">§</a><h3 class="code-header">impl<P, T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Receiver.html" title="trait core::ops::deref::Receiver">Receiver</a> for P<div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = T> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/ops/deref.rs.html#382">Source</a><a href="#associatedtype.Target-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Receiver.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>arbitrary_self_types</code>)</span></div></span><div class='docblock'>The target type on which the method may be called.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#85-87">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#89">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#90">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#94">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#827-829">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#811-813">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</div>","VarZeroSliceIter<'b, T, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"vecs/struct.VarZeroSliceIter.html\" title=\"struct zerovec::vecs::VarZeroSliceIter\">VarZeroSliceIter</a><'a, T, F></code></h3><pre><code><div class=\"where\">impl<'a, T: <a class=\"trait\" href=\"ule/trait.VarULE.html\" title=\"trait zerovec::ule::VarULE\">VarULE</a> + ?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>, F: <a class=\"trait\" href=\"vecs/trait.VarZeroVecFormat.html\" title=\"trait zerovec::vecs::VarZeroVecFormat\">VarZeroVecFormat</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"vecs/struct.VarZeroSliceIter.html\" title=\"struct zerovec::vecs::VarZeroSliceIter\">VarZeroSliceIter</a><'a, T, F></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.reference.html\">&'a T</a>;</div>"}</script></section></div></main></body></html> |