Files
phy/offset_allocator/trait.NodeIndex.html
Orion Kindel 0ce894e6b0 doc
2025-03-18 10:30:23 -05:00

22 lines
14 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Determines the number of allocations that the allocator supports."><title>NodeIndex in offset_allocator - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="offset_allocator" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[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="../offset_allocator/index.html">offset_<wbr>allocator</a><span class="version">0.2.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Node<wbr>Index</a></h2><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.MAX" title="MAX">MAX</a></li></ul><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.NonMax" title="NonMax">NonMax</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_u32" title="from_u32">from_u32</a></li><li><a href="#tymethod.to_usize" title="to_usize">to_usize</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-NodeIndex-for-u16" title="u16">u16</a></li><li><a href="#impl-NodeIndex-for-u32" title="u32">u32</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate offset_<wbr>allocator</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">offset_allocator</a></span><h1>Trait <span class="trait">NodeIndex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/offset_allocator/lib.rs.html#31-45">Source</a> </span></div><pre class="rust item-decl"><code>pub trait NodeIndex:
<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>
+ <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>
+ <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> {
type <a href="#associatedtype.NonMax" class="associatedtype">NonMax</a>: <a class="trait" href="trait.NodeIndexNonMax.html" title="trait offset_allocator::NodeIndexNonMax">NodeIndexNonMax</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;Self&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Self&gt;;
const <a href="#associatedconstant.MAX" class="constant">MAX</a>: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>;
// Required methods
fn <a href="#tymethod.from_u32" class="fn">from_u32</a>(val: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.to_usize" class="fn">to_usize</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Determines the number of allocations that the allocator supports.</p>
<p>By default, <a href="struct.Allocator.html" title="struct offset_allocator::Allocator"><code>Allocator</code></a> and related functions use <code>u32</code>, which allows for
<code>u32::MAX - 1</code> allocations. You can, however, use <code>u16</code> instead, which
causes the allocator to use less memory but limits the number of allocations
within a single allocator to at most 65,534.</p>
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.MAX" class="method"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#38">Source</a><h4 class="code-header">const <a href="#associatedconstant.MAX" class="constant">MAX</a>: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>The maximum value representable in this type.</p>
</div></details></div><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.NonMax" class="method"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#35">Source</a><h4 class="code-header">type <a href="#associatedtype.NonMax" class="associatedtype">NonMax</a>: <a class="trait" href="trait.NodeIndexNonMax.html" title="trait offset_allocator::NodeIndexNonMax">NodeIndexNonMax</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;Self&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>The <code>NonMax</code> version of this type.</p>
<p>This is used extensively to optimize <code>enum</code> representations.</p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.from_u32" class="method"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#41">Source</a><h4 class="code-header">fn <a href="#tymethod.from_u32" class="fn">from_u32</a>(val: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Converts from a unsigned 32-bit integer to an instance of this type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.to_usize" class="method"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#44">Source</a><h4 class="code-header">fn <a href="#tymethod.to_usize" class="fn">to_usize</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Converts this type to an unsigned machine word.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.0/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-NodeIndex-for-u16" class="impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#569-580">Source</a><a href="#impl-NodeIndex-for-u16" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NodeIndex.html" title="trait offset_allocator::NodeIndex">NodeIndex</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.MAX-1" class="associatedconstant trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#571">Source</a><a href="#associatedconstant.MAX-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.MAX" class="constant">MAX</a>: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a> = 65_535u32</h4></section><section id="associatedtype.NonMax-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#570">Source</a><a href="#associatedtype.NonMax-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.NonMax" class="associatedtype">NonMax</a> = <a class="struct" href="../nonmax/struct.NonMaxU16.html" title="struct nonmax::NonMaxU16">NonMaxU16</a></h4></section><section id="method.from_u32" class="method trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#573-575">Source</a><a href="#method.from_u32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.from_u32" class="fn">from_u32</a>(val: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4></section><section id="method.to_usize" class="method trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#577-579">Source</a><a href="#method.to_usize" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_usize" class="fn">to_usize</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-NodeIndex-for-u32" class="impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#556-567">Source</a><a href="#impl-NodeIndex-for-u32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NodeIndex.html" title="trait offset_allocator::NodeIndex">NodeIndex</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.MAX-2" class="associatedconstant trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#558">Source</a><a href="#associatedconstant.MAX-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.MAX" class="constant">MAX</a>: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a> = 4_294_967_295u32</h4></section><section id="associatedtype.NonMax-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#557">Source</a><a href="#associatedtype.NonMax-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.NonMax" class="associatedtype">NonMax</a> = <a class="struct" href="../nonmax/struct.NonMaxU32.html" title="struct nonmax::NonMaxU32">NonMaxU32</a></h4></section><section id="method.from_u32-1" class="method trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#560-562">Source</a><a href="#method.from_u32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.from_u32" class="fn">from_u32</a>(val: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4></section><section id="method.to_usize-1" class="method trait-impl"><a class="src rightside" href="../src/offset_allocator/lib.rs.html#564-566">Source</a><a href="#method.to_usize-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_usize" class="fn">to_usize</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/offset_allocator/trait.NodeIndex.js" data-ignore-extern-crates="std" async></script></section></div></main></body></html>