blob: 32edb14591aaf3286fca6b544fe63261db537959 [file] [log] [blame]
<!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="An array of dictionary encoded values"><title>DictionaryArray in arrow_array::array - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arrow_array" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (8c127df75 2024-05-16)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../arrow_array/index.html">arrow_array</a><span class="version">51.0.0</span></h2></div><h2 class="location"><a href="#">DictionaryArray</a></h2><div class="sidebar-elems"><section><h3><a href="#fields">Fields</a></h3><ul class="block structfield"><li><a href="#structfield.data_type">data_type</a></li><li><a href="#structfield.is_ordered">is_ordered</a></li><li><a href="#structfield.keys">keys</a></li><li><a href="#structfield.values">values</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.downcast_dict">downcast_dict</a></li><li><a href="#method.into_parts">into_parts</a></li><li><a href="#method.into_primitive_dict_builder">into_primitive_dict_builder</a></li><li><a href="#method.is_empty">is_empty</a></li><li><a href="#method.is_ordered">is_ordered</a></li><li><a href="#method.key">key</a></li><li><a href="#method.keys">keys</a></li><li><a href="#method.keys_iter">keys_iter</a></li><li><a href="#method.len">len</a></li><li><a href="#method.lookup_key">lookup_key</a></li><li><a href="#method.new">new</a></li><li><a href="#method.new_scalar">new_scalar</a></li><li><a href="#method.new_unchecked">new_unchecked</a></li><li><a href="#method.occupancy">occupancy</a></li><li><a href="#method.slice">slice</a></li><li><a href="#method.try_new">try_new</a></li><li><a href="#method.unary_mut">unary_mut</a></li><li><a href="#method.value_type">value_type</a></li><li><a href="#method.values">values</a></li><li><a href="#method.with_values">with_values</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AnyDictionaryArray-for-DictionaryArray%3CK%3E">AnyDictionaryArray</a></li><li><a href="#impl-Array-for-DictionaryArray%3CT%3E">Array</a></li><li><a href="#impl-Clone-for-DictionaryArray%3CK%3E">Clone</a></li><li><a href="#impl-Debug-for-DictionaryArray%3CT%3E">Debug</a></li><li><a href="#impl-From%3CArrayData%3E-for-DictionaryArray%3CT%3E">From&lt;ArrayData&gt;</a></li><li><a href="#impl-From%3CDictionaryArray%3CT%3E%3E-for-ArrayData">From&lt;DictionaryArray&lt;T&gt;&gt;</a></li><li><a href="#impl-FromIterator%3C%26str%3E-for-DictionaryArray%3CT%3E">FromIterator&lt;&amp;&#x27;a str&gt;</a></li><li><a href="#impl-FromIterator%3COption%3C%26str%3E%3E-for-DictionaryArray%3CT%3E">FromIterator&lt;Option&lt;&amp;&#x27;a str&gt;&gt;</a></li><li><a href="#impl-PartialEq-for-DictionaryArray%3CK%3E">PartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-DictionaryArray%3CK%3E">!RefUnwindSafe</a></li><li><a href="#impl-UnwindSafe-for-DictionaryArray%3CK%3E">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-DictionaryArray%3CK%3E">Freeze</a></li><li><a href="#impl-Send-for-DictionaryArray%3CK%3E">Send</a></li><li><a href="#impl-Sync-for-DictionaryArray%3CK%3E">Sync</a></li><li><a href="#impl-Unpin-for-DictionaryArray%3CK%3E">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-Datum-for-T">Datum</a></li><li><a href="#impl-From%3CT%3E-for-T">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-T">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In arrow_array::array</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="../index.html">arrow_array</a>::<wbr><a href="index.html">array</a>::<wbr><a class="struct" href="#">DictionaryArray</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/arrow_array/array/dictionary_array.rs.html#243-257">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub struct DictionaryArray&lt;K: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; {
data_type: <a class="enum" href="../../arrow_schema/datatype/enum.DataType.html" title="enum arrow_schema::datatype::DataType">DataType</a>,
keys: <a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;,
values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>,
is_ordered: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An array of <a href="https://arrow.apache.org/docs/format/Columnar.html#dictionary-encoded-layout">dictionary encoded values</a></p>
<p>This is mostly used to represent strings or a limited set of primitive types as integers,
for example when doing NLP analysis or representing chromosomes by name.</p>
<p><a href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray"><code>DictionaryArray</code></a> are represented using a <code>keys</code> array and a
<code>values</code> array, which may be different lengths. The <code>keys</code> array
stores indexes in the <code>values</code> array which holds
the corresponding logical value, as shown here:</p>
<div class="example-wrap"><pre class="language-text"><code>┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
┌─────────────────┐ ┌─────────┐ │ ┌─────────────────┐
│ │ A │ │ 0 │ │ A │ values[keys[0]]
├─────────────────┤ ├─────────┤ │ ├─────────────────┤
│ │ D │ │ 2 │ │ B │ values[keys[1]]
├─────────────────┤ ├─────────┤ │ ├─────────────────┤
│ │ B │ │ 2 │ │ B │ values[keys[2]]
└─────────────────┘ ├─────────┤ │ ├─────────────────┤
│ │ 1 │ │ D │ values[keys[3]]
├─────────┤ │ ├─────────────────┤
│ │ 1 │ │ D │ values[keys[4]]
├─────────┤ │ ├─────────────────┤
│ │ 0 │ │ A │ values[keys[5]]
└─────────┘ │ └─────────────────┘
│ values keys
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
Logical array
Contents
DictionaryArray
length = 6
</code></pre></div><h2 id="example-from-nullable-data"><a class="doc-anchor" href="#example-from-nullable-data">§</a>Example: From Nullable Data</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>test = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>];
<span class="kw">let </span>array : DictionaryArray&lt;Int8Type&gt; = test.iter().map(|<span class="kw-2">&amp;</span>x| <span class="kw">if </span>x == <span class="string">"b" </span>{<span class="prelude-val">None</span>} <span class="kw">else </span>{<span class="prelude-val">Some</span>(x)}).collect();
<span class="macro">assert_eq!</span>(array.keys(), <span class="kw-2">&amp;</span>Int8Array::from(<span class="macro">vec!</span>[<span class="prelude-val">Some</span>(<span class="number">0</span>), <span class="prelude-val">Some</span>(<span class="number">0</span>), <span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="number">1</span>)]));</code></pre></div>
<h2 id="example-from-non-nullable-data"><a class="doc-anchor" href="#example-from-non-nullable-data">§</a>Example: From Non-Nullable Data</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>test = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>];
<span class="kw">let </span>array : DictionaryArray&lt;Int8Type&gt; = test.into_iter().collect();
<span class="macro">assert_eq!</span>(array.keys(), <span class="kw-2">&amp;</span>Int8Array::from(<span class="macro">vec!</span>[<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>]));</code></pre></div>
<h2 id="example-from-existing-arrays"><a class="doc-anchor" href="#example-from-existing-arrays">§</a>Example: From Existing Arrays</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// You can form your own DictionaryArray by providing the
// values (dictionary) and keys (indexes into the dictionary):
</span><span class="kw">let </span>values = StringArray::from_iter_values([<span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>]);
<span class="kw">let </span>keys = Int8Array::from_iter_values([<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>]);
<span class="kw">let </span>array = DictionaryArray::&lt;Int8Type&gt;::try_new(keys, Arc::new(values)).unwrap();
<span class="kw">let </span>expected: DictionaryArray::&lt;Int8Type&gt; = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>].into_iter().collect();
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>array, <span class="kw-2">&amp;</span>expected);</code></pre></div>
<h2 id="example-using-builder"><a class="doc-anchor" href="#example-using-builder">§</a>Example: Using Builder</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>builder = StringDictionaryBuilder::&lt;Int32Type&gt;::new();
builder.append_value(<span class="string">"a"</span>);
builder.append_null();
builder.append_value(<span class="string">"a"</span>);
builder.append_value(<span class="string">"b"</span>);
<span class="kw">let </span>array = builder.finish();
<span class="kw">let </span>values: Vec&lt;<span class="kw">_</span>&gt; = array.downcast_dict::&lt;StringArray&gt;().unwrap().into_iter().collect();
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>values, <span class="kw-2">&amp;</span>[<span class="prelude-val">Some</span>(<span class="string">"a"</span>), <span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="string">"a"</span>), <span class="prelude-val">Some</span>(<span class="string">"b"</span>)]);</code></pre></div>
</div></details><h2 id="fields" class="fields section-header">Fields<a href="#fields" class="anchor">§</a></h2><span id="structfield.data_type" class="structfield section-header"><a href="#structfield.data_type" class="anchor field">§</a><code>data_type: <a class="enum" href="../../arrow_schema/datatype/enum.DataType.html" title="enum arrow_schema::datatype::DataType">DataType</a></code></span><span id="structfield.keys" class="structfield section-header"><a href="#structfield.keys" class="anchor field">§</a><code>keys: <a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;</code></span><div class="docblock"><p>The keys of this dictionary. These are constructed from the
buffer and null bitmap of <code>data</code>. Also, note that these do
not correspond to the true values of this array. Rather, they
map to the real values.</p>
</div><span id="structfield.values" class="structfield section-header"><a href="#structfield.values" class="anchor field">§</a><code>values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a></code></span><div class="docblock"><p>Array of dictionary values (can by any DataType).</p>
</div><span id="structfield.is_ordered" class="structfield section-header"><a href="#structfield.is_ordered" class="anchor field">§</a><code>is_ordered: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><div class="docblock"><p>Values are ordered.</p>
</div><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-DictionaryArray%3CK%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#270-575">source</a><a href="#impl-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</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/arrow_array/array/dictionary_array.rs.html#278-280">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(keys: <a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;, values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Attempt to create a new DictionaryArray with a specified keys
(indexes into the dictionary) and values (dictionary)
array.</p>
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>Panics if <a href="dictionary_array/struct.DictionaryArray.html#method.try_new" title="associated function arrow_array::array::dictionary_array::DictionaryArray::try_new"><code>Self::try_new</code></a> returns an error</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_new" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#289-314">source</a><h4 class="code-header">pub fn <a href="#method.try_new" class="fn">try_new</a>(
keys: <a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;,
values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="enum" href="../../arrow_schema/error/enum.ArrowError.html" title="enum arrow_schema::error::ArrowError">ArrowError</a>&gt;</h4></section></summary><div class="docblock"><p>Attempt to create a new DictionaryArray with a specified keys
(indexes into the dictionary) and values (dictionary)
array.</p>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>Returns an error if any <code>keys[i] &gt;= values.len() || keys[i] &lt; 0</code></p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_scalar" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#317-322">source</a><h4 class="code-header">pub fn <a href="#method.new_scalar" class="fn">new_scalar</a>&lt;T: <a class="trait" href="trait.Array.html" title="trait arrow_array::array::Array">Array</a> + 'static&gt;(value: <a class="struct" href="../scalar/struct.Scalar.html" title="struct arrow_array::scalar::Scalar">Scalar</a>&lt;T&gt;) -&gt; <a class="struct" href="../scalar/struct.Scalar.html" title="struct arrow_array::scalar::Scalar">Scalar</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Create a new <a href="../scalar/struct.Scalar.html" title="struct arrow_array::scalar::Scalar"><code>Scalar</code></a> from <code>value</code></p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_unchecked" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#329-341">source</a><h4 class="code-header">pub unsafe fn <a href="#method.new_unchecked" class="fn">new_unchecked</a>(keys: <a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;, values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new <a href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray"><code>DictionaryArray</code></a> without performing validation</p>
<h5 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h5>
<p>Safe provided <a href="dictionary_array/struct.DictionaryArray.html#method.try_new" title="associated function arrow_array::array::dictionary_array::DictionaryArray::try_new"><code>Self::try_new</code></a> would not return an error</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_parts" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#344-346">source</a><h4 class="code-header">pub fn <a href="#method.into_parts" class="fn">into_parts</a>(self) -&gt; (<a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;, <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>)</h4></section></summary><div class="docblock"><p>Deconstruct this array into its constituent parts</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.keys" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#349-351">source</a><h4 class="code-header">pub fn <a href="#method.keys" class="fn">keys</a>(&amp;self) -&gt; &amp;<a class="struct" href="primitive_array/struct.PrimitiveArray.html" title="struct arrow_array::array::primitive_array::PrimitiveArray">PrimitiveArray</a>&lt;K&gt;</h4></section></summary><div class="docblock"><p>Return an array view of the keys of this dictionary as a PrimitiveArray.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.lookup_key" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#358-364">source</a><h4 class="code-header">pub fn <a href="#method.lookup_key" class="fn">lookup_key</a>(&amp;self, value: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;K::<a class="associatedtype" href="../types/trait.ArrowPrimitiveType.html#associatedtype.Native" title="type arrow_array::types::ArrowPrimitiveType::Native">Native</a>&gt;</h4></section></summary><div class="docblock"><p>If <code>value</code> is present in <code>values</code> (aka the dictionary),
returns the corresponding key (index into the <code>values</code>
array). Otherwise returns <code>None</code>.</p>
<p>Panics if <code>values</code> is not a <a href="string_array/type.StringArray.html" title="type arrow_array::array::string_array::StringArray"><code>StringArray</code></a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.values" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#367-369">source</a><h4 class="code-header">pub fn <a href="#method.values" class="fn">values</a>(&amp;self) -&gt; &amp;<a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a></h4></section></summary><div class="docblock"><p>Returns a reference to the dictionary values array</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.value_type" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#372-374">source</a><h4 class="code-header">pub fn <a href="#method.value_type" class="fn">value_type</a>(&amp;self) -&gt; <a class="enum" href="../../arrow_schema/datatype/enum.DataType.html" title="enum arrow_schema::datatype::DataType">DataType</a></h4></section></summary><div class="docblock"><p>Returns a clone of the value type of this list.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#377-379">source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>The length of the dictionary is the length of the keys array.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#382-384">source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Whether this dictionary is empty</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_ordered" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#387-389">source</a><h4 class="code-header">pub fn <a href="#method.is_ordered" class="fn">is_ordered</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Currently exists for compatibility purposes with Arrow IPC.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.keys_iter" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#392-394">source</a><h4 class="code-header">pub fn <a href="#method.keys_iter" class="fn">keys_iter</a>(&amp;self) -&gt; impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt; + '_</h4></section></summary><div class="docblock"><p>Return an iterator over the keys (indexes into the dictionary)</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.key" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#398-400">source</a><h4 class="code-header">pub fn <a href="#method.key" class="fn">key</a>(&amp;self, i: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>Return the value of <code>keys</code> (the dictionary key) at index <code>i</code>,
cast to <code>usize</code>, <code>None</code> if the value at <code>i</code> is <code>NULL</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.slice" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#403-410">source</a><h4 class="code-header">pub fn <a href="#method.slice" class="fn">slice</a>(&amp;self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, length: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Returns a zero-copy slice of this array with the indicated offset and length.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_dict" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#425-431">source</a><h4 class="code-header">pub fn <a href="#method.downcast_dict" class="fn">downcast_dict</a>&lt;V: 'static&gt;(
&amp;self
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="dictionary_array/struct.TypedDictionaryArray.html" title="struct arrow_array::array::dictionary_array::TypedDictionaryArray">TypedDictionaryArray</a>&lt;'_, K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Downcast this dictionary to a <a href="dictionary_array/struct.TypedDictionaryArray.html" title="struct arrow_array::array::dictionary_array::TypedDictionaryArray"><code>TypedDictionaryArray</code></a></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>arrow_array::{Array, ArrayAccessor, DictionaryArray, StringArray, types::Int32Type};
<span class="kw">let </span>orig = [<span class="prelude-val">Some</span>(<span class="string">"a"</span>), <span class="prelude-val">Some</span>(<span class="string">"b"</span>), <span class="prelude-val">None</span>];
<span class="kw">let </span>dictionary = DictionaryArray::&lt;Int32Type&gt;::from_iter(orig);
<span class="kw">let </span>typed = dictionary.downcast_dict::&lt;StringArray&gt;().unwrap();
<span class="macro">assert_eq!</span>(typed.value(<span class="number">0</span>), <span class="string">"a"</span>);
<span class="macro">assert_eq!</span>(typed.value(<span class="number">1</span>), <span class="string">"b"</span>);
<span class="macro">assert!</span>(typed.is_null(<span class="number">2</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_values" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#470-480">source</a><h4 class="code-header">pub fn <a href="#method.with_values" class="fn">with_values</a>(&amp;self, values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Returns a new dictionary with the same keys as the current instance
but with a different set of dictionary values</p>
<p>This can be used to perform an operation on the values of a dictionary</p>
<h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
<p>Panics if <code>values</code> has a length less than the current values</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
<span class="comment">// Construct a Dict(Int32, Int8)
</span><span class="kw">let </span><span class="kw-2">mut </span>builder = PrimitiveDictionaryBuilder::&lt;Int32Type, Int8Type&gt;::with_capacity(<span class="number">2</span>, <span class="number">200</span>);
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..<span class="number">100 </span>{
builder.append(i % <span class="number">2</span>).unwrap();
}
<span class="kw">let </span>dictionary = builder.finish();
<span class="comment">// Perform a widening cast of dictionary values
</span><span class="kw">let </span>typed_dictionary = dictionary.downcast_dict::&lt;Int8Array&gt;().unwrap();
<span class="kw">let </span>values: Int64Array = typed_dictionary.values().unary(|x| x <span class="kw">as </span>i64);
<span class="comment">// Create a Dict(Int32,
</span><span class="kw">let </span>new = dictionary.with_values(Arc::new(values));
<span class="comment">// Verify values are as expected
</span><span class="kw">let </span>new_typed = new.downcast_dict::&lt;Int64Array&gt;().unwrap();
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..<span class="number">100 </span>{
<span class="macro">assert_eq!</span>(new_typed.value(i), (i % <span class="number">2</span>) <span class="kw">as </span>i64)
}</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_primitive_dict_builder" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#484-515">source</a><h4 class="code-header">pub fn <a href="#method.into_primitive_dict_builder" class="fn">into_primitive_dict_builder</a>&lt;V&gt;(
self
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../builder/primitive_dictionary_builder/struct.PrimitiveDictionaryBuilder.html" title="struct arrow_array::builder::primitive_dictionary_builder::PrimitiveDictionaryBuilder">PrimitiveDictionaryBuilder</a>&lt;K, V&gt;, Self&gt;<div class="where">where
V: <a class="trait" href="../types/trait.ArrowPrimitiveType.html" title="trait arrow_array::types::ArrowPrimitiveType">ArrowPrimitiveType</a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>PrimitiveDictionaryBuilder</code> of this dictionary array for mutating
its keys and values if the underlying data buffer is not shared by others.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.unary_mut" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#540-551">source</a><h4 class="code-header">pub fn <a href="#method.unary_mut" class="fn">unary_mut</a>&lt;F, V&gt;(
self,
op: F
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;, <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;&gt;<div class="where">where
V: <a class="trait" href="../types/trait.ArrowPrimitiveType.html" title="trait arrow_array::types::ArrowPrimitiveType">ArrowPrimitiveType</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(V::<a class="associatedtype" href="../types/trait.ArrowPrimitiveType.html#associatedtype.Native" title="type arrow_array::types::ArrowPrimitiveType::Native">Native</a>) -&gt; V::<a class="associatedtype" href="../types/trait.ArrowPrimitiveType.html#associatedtype.Native" title="type arrow_array::types::ArrowPrimitiveType::Native">Native</a>,</div></h4></section></summary><div class="docblock"><p>Applies an unary and infallible function to a mutable dictionary array.
Mutable dictionary array means that the buffers are not shared with other arrays.
As a result, this mutates the buffers directly without allocating new buffers.</p>
<h5 id="implementation"><a class="doc-anchor" href="#implementation">§</a>Implementation</h5>
<p>This will apply the function for all dictionary values, including those on null slots.
This implies that the operation must be infallible for any value of the corresponding type
or this function may panic.</p>
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>values = Int32Array::from(<span class="macro">vec!</span>[<span class="prelude-val">Some</span>(<span class="number">10</span>), <span class="prelude-val">Some</span>(<span class="number">20</span>), <span class="prelude-val">None</span>]);
<span class="kw">let </span>keys = Int8Array::from_iter_values([<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>]);
<span class="kw">let </span>dictionary = DictionaryArray::&lt;Int8Type&gt;::try_new(keys, Arc::new(values)).unwrap();
<span class="kw">let </span>c = dictionary.unary_mut::&lt;<span class="kw">_</span>, Int32Type&gt;(|x| x + <span class="number">1</span>).unwrap();
<span class="kw">let </span>typed = c.downcast_dict::&lt;Int32Array&gt;().unwrap();
<span class="macro">assert_eq!</span>(typed.value(<span class="number">0</span>), <span class="number">11</span>);
<span class="macro">assert_eq!</span>(typed.value(<span class="number">1</span>), <span class="number">11</span>);
<span class="macro">assert_eq!</span>(typed.value(<span class="number">2</span>), <span class="number">21</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.occupancy" class="method"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#557-574">source</a><h4 class="code-header">pub fn <a href="#method.occupancy" class="fn">occupancy</a>(&amp;self) -&gt; BooleanBuffer</h4></section></summary><div class="docblock"><p>Computes an occupancy mask for this dictionary’s values</p>
<p>For each value in <a href="dictionary_array/struct.DictionaryArray.html#method.values" title="method arrow_array::array::dictionary_array::DictionaryArray::values"><code>Self::values</code></a> the corresponding bit will be set in the
returned mask if it is referenced by a key in this <a href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray"><code>DictionaryArray</code></a></p>
</div></details></div></details></div><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-AnyDictionaryArray-for-DictionaryArray%3CK%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#994-1013">source</a><a href="#impl-AnyDictionaryArray-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="dictionary_array/trait.AnyDictionaryArray.html" title="trait arrow_array::array::dictionary_array::AnyDictionaryArray">AnyDictionaryArray</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.keys-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#995-997">source</a><a href="#method.keys-1" class="anchor">§</a><h4 class="code-header">fn <a href="dictionary_array/trait.AnyDictionaryArray.html#tymethod.keys" class="fn">keys</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="trait.Array.html" title="trait arrow_array::array::Array">Array</a></h4></section></summary><div class='docblock'>Returns the primitive keys of this dictionary as an <a href="trait.Array.html" title="trait arrow_array::array::Array"><code>Array</code></a></div></details><details class="toggle method-toggle" open><summary><section id="method.values-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#999-1001">source</a><a href="#method.values-1" class="anchor">§</a><h4 class="code-header">fn <a href="dictionary_array/trait.AnyDictionaryArray.html#tymethod.values" class="fn">values</a>(&amp;self) -&gt; &amp;<a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a></h4></section></summary><div class='docblock'>Returns the values of this dictionary</div></details><details class="toggle method-toggle" open><summary><section id="method.normalized_keys" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#1003-1008">source</a><a href="#method.normalized_keys" class="anchor">§</a><h4 class="code-header">fn <a href="dictionary_array/trait.AnyDictionaryArray.html#tymethod.normalized_keys" class="fn">normalized_keys</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class='docblock'>Returns the keys of this dictionary as usize <a href="dictionary_array/trait.AnyDictionaryArray.html#tymethod.normalized_keys">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_values-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#1010-1012">source</a><a href="#method.with_values-1" class="anchor">§</a><h4 class="code-header">fn <a href="dictionary_array/trait.AnyDictionaryArray.html#tymethod.with_values" class="fn">with_values</a>(&amp;self, values: <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a>) -&gt; <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a></h4></section></summary><div class='docblock'>Create a new <a href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray"><code>DictionaryArray</code></a> replacing <code>values</code> with the new values <a href="dictionary_array/trait.AnyDictionaryArray.html#tymethod.with_values">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Array-for-DictionaryArray%3CT%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#694-765">source</a><a href="#impl-Array-for-DictionaryArray%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="trait.Array.html" title="trait arrow_array::array::Array">Array</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_any" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#695-697">source</a><a href="#method.as_any" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.as_any" class="fn">as_any</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a></h4></section></summary><div class='docblock'>Returns the array as <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any"><code>Any</code></a> so that it can be
downcasted to a specific implementation. <a href="trait.Array.html#tymethod.as_any">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.to_data" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#699-701">source</a><a href="#method.to_data" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.to_data" class="fn">to_data</a>(&amp;self) -&gt; <a class="struct" href="../../arrow_data/data/struct.ArrayData.html" title="struct arrow_data::data::ArrayData">ArrayData</a></h4></section></summary><div class='docblock'>Returns the underlying data of this array</div></details><details class="toggle method-toggle" open><summary><section id="method.into_data" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#703-705">source</a><a href="#method.into_data" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.into_data" class="fn">into_data</a>(self) -&gt; <a class="struct" href="../../arrow_data/data/struct.ArrayData.html" title="struct arrow_data::data::ArrayData">ArrayData</a></h4></section></summary><div class='docblock'>Returns the underlying data of this array <a href="trait.Array.html#tymethod.into_data">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.data_type" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#707-709">source</a><a href="#method.data_type" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.data_type" class="fn">data_type</a>(&amp;self) -&gt; &amp;<a class="enum" href="../../arrow_schema/datatype/enum.DataType.html" title="enum arrow_schema::datatype::DataType">DataType</a></h4></section></summary><div class='docblock'>Returns a reference to the <a href="../../arrow_schema/datatype/enum.DataType.html" title="enum arrow_schema::datatype::DataType"><code>DataType</code></a> of this array. <a href="trait.Array.html#tymethod.data_type">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.slice-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#711-713">source</a><a href="#method.slice-1" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.slice" class="fn">slice</a>(&amp;self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, length: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="type" href="type.ArrayRef.html" title="type arrow_array::array::ArrayRef">ArrayRef</a></h4></section></summary><div class='docblock'>Returns a zero-copy slice of this array with the indicated offset and length. <a href="trait.Array.html#tymethod.slice">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.len-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#715-717">source</a><a href="#method.len-1" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.len" class="fn">len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Returns the length (i.e., number of elements) of this array. <a href="trait.Array.html#tymethod.len">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#719-721">source</a><a href="#method.is_empty-1" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Returns whether this array is empty. <a href="trait.Array.html#tymethod.is_empty">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.offset" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#723-725">source</a><a href="#method.offset" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.offset" class="fn">offset</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Returns the offset into the underlying data used by this array(-slice).
Note that the underlying data can be shared by many arrays.
This defaults to <code>0</code>. <a href="trait.Array.html#tymethod.offset">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.nulls" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#727-729">source</a><a href="#method.nulls" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.nulls" class="fn">nulls</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;NullBuffer&gt;</h4></section></summary><div class='docblock'>Returns the null buffer of this array if any. <a href="trait.Array.html#tymethod.nulls">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.logical_nulls" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#731-750">source</a><a href="#method.logical_nulls" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#method.logical_nulls" class="fn">logical_nulls</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;NullBuffer&gt;</h4></section></summary><div class='docblock'>Returns a potentially computed [<code>NullBuffer</code>] that represents the logical
null values of this array, if any. <a href="trait.Array.html#method.logical_nulls">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_nullable" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#752-754">source</a><a href="#method.is_nullable" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#method.is_nullable" class="fn">is_nullable</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Returns <code>false</code> if the array is guaranteed to not contain any logical nulls <a href="trait.Array.html#method.is_nullable">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.get_buffer_memory_size" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#756-758">source</a><a href="#method.get_buffer_memory_size" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.get_buffer_memory_size" class="fn">get_buffer_memory_size</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Returns the total number of bytes of memory pointed to by this array.
The buffers store bytes in the Arrow memory format, and include the data as well as the validity map.
Note that this does not always correspond to the exact memory usage of an array,
since multiple arrays can share the same buffers or slices thereof.</div></details><details class="toggle method-toggle" open><summary><section id="method.get_array_memory_size" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#760-764">source</a><a href="#method.get_array_memory_size" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#tymethod.get_array_memory_size" class="fn">get_array_memory_size</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Returns the total number of bytes of memory occupied physically by this array.
This value will always be greater than returned by <code>get_buffer_memory_size()</code> and
includes the overhead of the data structures that contain the pointers to the various buffers.</div></details><details class="toggle method-toggle" open><summary><section id="method.is_null" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/mod.rs.html#237-239">source</a><a href="#method.is_null" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#method.is_null" class="fn">is_null</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Returns whether the element at <code>index</code> is null according to <a href="trait.Array.html#tymethod.nulls" title="method arrow_array::array::Array::nulls"><code>Array::nulls</code></a> <a href="trait.Array.html#method.is_null">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_valid" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/mod.rs.html#254-256">source</a><a href="#method.is_valid" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#method.is_valid" class="fn">is_valid</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Returns whether the element at <code>index</code> is <em>not</em> null, the
opposite of <a href="trait.Array.html#method.is_null"><code>Self::is_null</code></a>. <a href="trait.Array.html#method.is_valid">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.null_count" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/mod.rs.html#273-275">source</a><a href="#method.null_count" class="anchor">§</a><h4 class="code-header">fn <a href="trait.Array.html#method.null_count" class="fn">null_count</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Returns the total number of physical null values in this array. <a href="trait.Array.html#method.null_count">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-DictionaryArray%3CK%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#259-268">source</a><a href="#impl-Clone-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</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/arrow_array/array/dictionary_array.rs.html#260-267">source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&amp;self) -&gt; Self</h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#169">source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Self</a>)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-DictionaryArray%3CT%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#767-775">source</a><a href="#impl-Debug-for-DictionaryArray%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;</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/arrow_array/array/dictionary_array.rs.html#768-774">source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/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/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CArrayData%3E-for-DictionaryArray%3CT%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#578-624">source</a><a href="#impl-From%3CArrayData%3E-for-DictionaryArray%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="../../arrow_data/data/struct.ArrayData.html" title="struct arrow_data::data::ArrayData">ArrayData</a>&gt; for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;</h3></section></summary><div class="docblock"><p>Constructs a <code>DictionaryArray</code> from an array data reference.</p>
</div><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="../../src/arrow_array/array/dictionary_array.rs.html#579-623">source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(data: <a class="struct" href="../../arrow_data/data/struct.ArrayData.html" title="struct arrow_data::data::ArrayData">ArrayData</a>) -&gt; 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-From%3CDictionaryArray%3CT%3E%3E-for-ArrayData" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#626-637">source</a><a href="#impl-From%3CDictionaryArray%3CT%3E%3E-for-ArrayData" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;&gt; for <a class="struct" href="../../arrow_data/data/struct.ArrayData.html" title="struct arrow_data::data::ArrayData">ArrayData</a></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/arrow_array/array/dictionary_array.rs.html#627-636">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(array: <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;) -&gt; 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-FromIterator%3C%26str%3E-for-DictionaryArray%3CT%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#679-692">source</a><a href="#impl-FromIterator%3C%26str%3E-for-DictionaryArray%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a>&lt;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt; for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;</h3></section></summary><div class="docblock"><p>Constructs a <code>DictionaryArray</code> from an iterator of strings.</p>
<h4 id="example-2"><a class="doc-anchor" href="#example-2">§</a>Example:</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>arrow_array::{DictionaryArray, PrimitiveArray, StringArray, types::Int8Type};
<span class="kw">let </span>test = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>];
<span class="kw">let </span>array: DictionaryArray&lt;Int8Type&gt; = test.into_iter().collect();
<span class="macro">assert_eq!</span>(
<span class="string">"DictionaryArray {keys: PrimitiveArray&lt;Int8&gt;\n[\n 0,\n 0,\n 1,\n 2,\n] values: StringArray\n[\n \"a\",\n \"b\",\n \"c\",\n]}\n"</span>,
<span class="macro">format!</span>(<span class="string">"{:?}"</span>, array)
);</code></pre></div>
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_iter-1" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#680-691">source</a><a href="#method.from_iter-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter" class="fn">from_iter</a>&lt;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;(iter: I) -&gt; Self</h4></section></summary><div class='docblock'>Creates a value from an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-FromIterator%3COption%3C%26str%3E%3E-for-DictionaryArray%3CT%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#655-663">source</a><a href="#impl-FromIterator%3COption%3C%26str%3E%3E-for-DictionaryArray%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt; for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;T&gt;</h3></section></summary><div class="docblock"><p>Constructs a <code>DictionaryArray</code> from an iterator of optional strings.</p>
<h4 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example:</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>arrow_array::{DictionaryArray, PrimitiveArray, StringArray, types::Int8Type};
<span class="kw">let </span>test = <span class="macro">vec!</span>[<span class="string">"a"</span>, <span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>];
<span class="kw">let </span>array: DictionaryArray&lt;Int8Type&gt; = test
.iter()
.map(|<span class="kw-2">&amp;</span>x| <span class="kw">if </span>x == <span class="string">"b" </span>{ <span class="prelude-val">None </span>} <span class="kw">else </span>{ <span class="prelude-val">Some</span>(x) })
.collect();
<span class="macro">assert_eq!</span>(
<span class="string">"DictionaryArray {keys: PrimitiveArray&lt;Int8&gt;\n[\n 0,\n 0,\n null,\n 1,\n] values: StringArray\n[\n \"a\",\n \"c\",\n]}\n"</span>,
<span class="macro">format!</span>(<span class="string">"{:?}"</span>, array)
);</code></pre></div>
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_iter" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/array/dictionary_array.rs.html#656-662">source</a><a href="#method.from_iter" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter" class="fn">from_iter</a>&lt;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;&gt;(iter: I) -&gt; Self</h4></section></summary><div class='docblock'>Creates a value from an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-DictionaryArray%3CK%3E" class="impl"><a class="src rightside" href="../../src/arrow_array/array/mod.rs.html#486-490">source</a><a href="#impl-PartialEq-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K: <a class="trait" href="../types/trait.ArrowDictionaryKeyType.html" title="trait arrow_array::types::ArrowDictionaryKeyType">ArrowDictionaryKeyType</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</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/arrow_array/array/mod.rs.html#487-489">source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Self</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#263">source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details></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-DictionaryArray%3CK%3E" class="impl"><a href="#impl-Freeze-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</h3></section><section id="impl-RefUnwindSafe-for-DictionaryArray%3CK%3E" class="impl"><a href="#impl-RefUnwindSafe-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</h3></section><section id="impl-Send-for-DictionaryArray%3CK%3E" class="impl"><a href="#impl-Send-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</h3></section><section id="impl-Sync-for-DictionaryArray%3CK%3E" class="impl"><a href="#impl-Sync-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</h3></section><section id="impl-Unpin-for-DictionaryArray%3CK%3E" class="impl"><a href="#impl-Unpin-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;<div class="where">where
&lt;K as <a class="trait" href="../types/trait.ArrowPrimitiveType.html" title="trait arrow_array::types::ArrowPrimitiveType">ArrowPrimitiveType</a>&gt;::<a class="associatedtype" href="../types/trait.ArrowPrimitiveType.html#associatedtype.Native" title="type arrow_array::types::ArrowPrimitiveType::Native">Native</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-DictionaryArray%3CK%3E" class="impl"><a href="#impl-UnwindSafe-for-DictionaryArray%3CK%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="dictionary_array/struct.DictionaryArray.html" title="struct arrow_array::array::dictionary_array::DictionaryArray">DictionaryArray</a>&lt;K&gt;</h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#140">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Datum-for-T" class="impl"><a class="src rightside" href="../../src/arrow_array/scalar.rs.html#83-87">source</a><a href="#impl-Datum-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../scalar/trait.Datum.html" title="trait arrow_array::scalar::Datum">Datum</a> for T<div class="where">where
T: <a class="trait" href="trait.Array.html" title="trait arrow_array::array::Array">Array</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.get" class="method trait-impl"><a class="src rightside" href="../../src/arrow_array/scalar.rs.html#84-86">source</a><a href="#method.get" class="anchor">§</a><h4 class="code-header">fn <a href="../scalar/trait.Datum.html#tymethod.get" class="fn">get</a>(&amp;self) -&gt; (&amp;dyn <a class="trait" href="trait.Array.html" title="trait arrow_array::array::Array">Array</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</h4></section></summary><div class='docblock'>Returns the value for this <a href="../scalar/trait.Datum.html" title="trait arrow_array::scalar::Datum"><code>Datum</code></a> and a boolean indicating if the value is scalar</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a><a href="#method.from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#83-85">source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#88">source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#92">source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>