pub struct TableId(/* private fields */);
Expand description
An opaque unique ID for a Table
within a World
.
Can be used with Tables::get
to fetch the corresponding
table.
Each Archetype
always points to a table via Archetype::table_id
.
Multiple archetypes can point to the same table so long as the components
stored in the table are identical, but do not share the same sparse set
components.
Implementations§
source§impl TableId
impl TableId
sourcepub const fn from_u32(index: u32) -> Self
pub const fn from_u32(index: u32) -> Self
Creates a new TableId
.
index
must be retrieved from calling TableId::as_u32
on a TableId
you got
from a table of a given World
or the created ID may be invalid.
sourcepub const fn from_usize(index: usize) -> Self
pub const fn from_usize(index: usize) -> Self
Creates a new TableId
.
index
must be retrieved from calling TableId::as_usize
on a TableId
you got
from a table of a given World
or the created ID may be invalid.
Panics
Will panic if the provided value does not fit within a u32
.
Trait Implementations§
source§impl PartialEq for TableId
impl PartialEq for TableId
impl Copy for TableId
impl Eq for TableId
impl StructuralEq for TableId
impl StructuralPartialEq for TableId
Auto Trait Implementations§
impl RefUnwindSafe for TableId
impl Send for TableId
impl Sync for TableId
impl Unpin for TableId
impl UnwindSafe for TableId
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
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
Compare self to
key
and return true
if they are equal.