Struct comfy_wgpu::Index
pub struct Index { /* private fields */ }Expand description
Index type for Arena that has a generation attached to it.
Implementations§
§impl Index
impl Index
pub 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>.
pub 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.
pub 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.
pub const fn generation(self) -> u32
pub const fn generation(self) -> u32
Convert this Index into a generation, discarding its slot.
Trait Implementations§
§impl Ord for Index
impl Ord for Index
§impl PartialOrd<Index> for Index
impl PartialOrd<Index> for Index
§fn partial_cmp(&self, other: &Index) -> Option<Ordering>
fn partial_cmp(&self, other: &Index) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Copy for Index
impl Eq for Index
impl StructuralEq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.