pub struct Index { /* private fields */ }
Expand description
Index type for Arena
that has a generation attached to it.
Implementations§
Source§impl Index
impl Index
Sourcepub const DANGLING: Index
pub const DANGLING: Index
Represents an Index
that is unlikely to be in use. This is useful for
programs that want to do two-phase initialization in safe Rust. Avoid
using this value to represent the absence of an Index
: prefer
Option<Index>
.
Sourcepub const fn to_bits(self) -> u64
pub const fn to_bits(self) -> u64
Convert this Index
to an equivalent u64
representation. Mostly
useful for passing to code outside of Rust.
Sourcepub const fn from_bits(bits: u64) -> Option<Index>
pub const fn from_bits(bits: u64) -> Option<Index>
Create an Index
from bits created with Index::to_bits
.
If this function is called with bits that are not valid for an Index
,
returns None
. This can happen if the encoded generation value is 0,
for example.
§Stability
Bits from Index
values are guaranteed to be compatible within all
semver-compatible versions of Thunderdome. That is, using
Index::to_bits
in 0.4.0 and Index::from_bits
in 0.4.2 is guaranteed
to work.
Sourcepub const fn generation(self) -> u32
pub const fn generation(self) -> u32
Convert this Index
into a generation, discarding its slot.
Trait Implementations§
Source§impl Ord for Index
impl Ord for Index
Source§impl PartialOrd for Index
impl PartialOrd for Index
impl Copy for Index
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more