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§
impl Copy for TableId
impl Eq for TableId
impl StructuralPartialEq for TableId
Auto Trait Implementations§
impl Freeze for TableId
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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§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.