<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../tinyvec/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Trait <ahref="index.html">tinyvec</a>::<wbr><aclass="trait"href="#">Array</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../src/tinyvec/array.rs.html#19-42">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub trait Array {
type <ahref="#associatedtype.Item"class="associatedtype">Item</a>: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/default/trait.Default.html"title="trait core::default::Default">Default</a>;
}</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A trait for types that are an array.</p>
<p>An “array”, for our purposes, has the following properties:</p>
<li>The element type can be generic, but must implement <ahref="https://doc.rust-lang.org/1.77.1/core/default/trait.Default.html"title="trait core::default::Default"><code>Default</code></a>.</li>
</div></details><h2id="required-associated-types"class="section-header">Required Associated Types<ahref="#required-associated-types"class="anchor">§</a></h2><divclass="methods"><detailsclass="toggle"open><summary><sectionid="associatedtype.Item"class="method"><aclass="src rightside"href="../src/tinyvec/array.rs.html#21">source</a><h4class="code-header">type <ahref="#associatedtype.Item"class="associatedtype">Item</a>: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/default/trait.Default.html"title="trait core::default::Default">Default</a></h4></section></summary><divclass="docblock"><p>The type of the items in the thing.</p>
</div></details></div><h2id="required-associated-consts"class="section-header">Required Associated Constants<ahref="#required-associated-consts"class="anchor">§</a></h2><divclass="methods"><detailsclass="toggle"open><summary><sectionid="associatedconstant.CAPACITY"class="method"><aclass="src rightside"href="../src/tinyvec/array.rs.html#24">source</a><h4class="code-header">const <ahref="#associatedconstant.CAPACITY"class="constant">CAPACITY</a>: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/core/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>The number of slots in the thing.</p>
</div></details></div><h2id="required-methods"class="section-header">Required Methods<ahref="#required-methods"class="anchor">§</a></h2><divclass="methods"><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.as_slice"class="method"><aclass="src rightside"href="../src/tinyvec/array.rs.html#30">source</a><h4class="code-header">fn <ahref="#tymethod.as_slice"class="fn">as_slice</a>(&self) ->&[Self::<aclass="associatedtype"href="trait.Array.html#associatedtype.Item"title="type tinyvec::Array::Item">Item</a>]</h4></section></summary><divclass="docblock"><p>Gives a shared slice over the whole thing.</p>
<p>A correct implementation will return a slice with a length equal to the
<code>CAPACITY</code> value.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.as_slice_mut"class="method"><aclass="src rightside"href="../src/tinyvec/array.rs.html#36">source</a><h4class="code-header">fn <ahref="#tymethod.as_slice_mut"class="fn">as_slice_mut</a>(&mut self) ->&mut [Self::<aclass="associatedtype"href="trait.Array.html#associatedtype.Item"title="type tinyvec::Array::Item">Item</a>]</h4></section></summary><divclass="docblock"><p>Gives a unique slice over the whole thing.</p>
<p>A correct implementation will return a slice with a length equal to the
<code>CAPACITY</code> value.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.default"class="method"><aclass="src rightside"href="../src/tinyvec/array.rs.html#41">source</a><h4class="code-header">fn <ahref="#tymethod.default"class="fn">default</a>() -> Self</h4></section></summary><divclass="docblock"><p>Create a default-initialized instance of ourself, similar to the
<ahref="https://doc.rust-lang.org/1.77.1/core/default/trait.Default.html"title="trait core::default::Default"><code>Default</code></a> trait, but implemented for the same range of sizes as