pub struct Entity(/* private fields */);Expand description
An entity index.
They are created using the Entities struct.
They are used as indices with Components structs.
Entities are conceptual “things” which possess attributes (Components). As an exemple, a Car (Entity) has a Color (Component), a Position (Component) and a Speed (Component).
Implementations§
Source§impl Entity
impl Entity
Sourcepub fn index(&self) -> u32
pub fn index(&self) -> u32
Returns the index of this Entity.
In most cases, you do not want to use this directly. However, it can be useful to create caches to improve performances.
Sourcepub fn generation(&self) -> u32
pub fn generation(&self) -> u32
Returns the generation of this Entity.
In most cases, you do not want to use this directly. However, it can be useful to create caches to improve performances.
Trait Implementations§
impl Copy for Entity
impl Eq for Entity
impl StructuralPartialEq for Entity
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnwindSafe for Entity
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