pub struct ResourceIndex(/* private fields */);
Expand description
Index pointing to a resource within a component.
This index space covers all unique resource type definitions. For
example all unique imports come first and then all locally-defined
resources come next. Note that this does not count the number of runtime
tables required to track resources (that’s TypeResourceTableIndex
instead). Instead this is a count of the number of unique
(type (resource (rep ..)))
declarations within a component, plus
imports.
This is then used for correlating various information such as destructors, origin information, etc.
Implementations§
Source§impl ResourceIndex
impl ResourceIndex
Sourcepub fn as_bits(self) -> u32
pub fn as_bits(self) -> u32
Return the raw bit encoding for this instance.
Warning: the raw bit encoding is opaque and has no
guaranteed correspondence to the entity’s index. It encodes the
entire state of this index value: either a valid index or an
invalid-index sentinel. The value returned by this method should
only be passed to from_bits
.
Sourcepub fn from_bits(x: u32) -> Self
pub fn from_bits(x: u32) -> Self
Create a new instance from the raw bit encoding.
Warning: the raw bit encoding is opaque and has no
guaranteed correspondence to the entity’s index. It encodes the
entire state of this index value: either a valid index or an
invalid-index sentinel. The value returned by this method should
only be given bits from as_bits
.
Trait Implementations§
Source§impl Clone for ResourceIndex
impl Clone for ResourceIndex
Source§fn clone(&self) -> ResourceIndex
fn clone(&self) -> ResourceIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ResourceIndex
impl Debug for ResourceIndex
Source§impl<'de> Deserialize<'de> for ResourceIndex
impl<'de> Deserialize<'de> for ResourceIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl EntityRef for ResourceIndex
impl EntityRef for ResourceIndex
Source§impl Hash for ResourceIndex
impl Hash for ResourceIndex
Source§impl Ord for ResourceIndex
impl Ord for ResourceIndex
Source§fn cmp(&self, other: &ResourceIndex) -> Ordering
fn cmp(&self, other: &ResourceIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ResourceIndex
impl PartialEq for ResourceIndex
Source§impl PartialOrd for ResourceIndex
impl PartialOrd for ResourceIndex
Source§impl ReservedValue for ResourceIndex
impl ReservedValue for ResourceIndex
Source§fn reserved_value() -> ResourceIndex
fn reserved_value() -> ResourceIndex
Source§fn is_reserved_value(&self) -> bool
fn is_reserved_value(&self) -> bool
Source§impl Serialize for ResourceIndex
impl Serialize for ResourceIndex
impl Copy for ResourceIndex
impl Eq for ResourceIndex
impl StructuralPartialEq for ResourceIndex
Auto Trait Implementations§
impl Freeze for ResourceIndex
impl RefUnwindSafe for ResourceIndex
impl Send for ResourceIndex
impl Sync for ResourceIndex
impl Unpin for ResourceIndex
impl UnwindSafe for ResourceIndex
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.