pub struct GlobalEventId(/* private fields */);
Expand description
Lightweight identifier for a global event type.
Event identifiers are implemented using an index and a generation count. The generation count ensures that IDs from despawned events are not reused by new events.
An event identifier is only meaningful in the World
it was created
from. Attempting to use an event ID in a different world will have
unexpected results.
Implementations§
Source§impl GlobalEventId
impl GlobalEventId
Sourcepub const NULL: GlobalEventId
pub const NULL: GlobalEventId
The global event ID which never identifies a live entity. This is the
default value for EntityId
.
Sourcepub const fn new(index: u32, generation: u32) -> Option<GlobalEventId>
pub const fn new(index: u32, generation: u32) -> Option<GlobalEventId>
Creates a new entity ID from an index and generation count. Returns
None
if a valid ID is not formed.
Sourcepub const fn index(self) -> GlobalEventIdx
pub const fn index(self) -> GlobalEventIdx
Returns the index of this ID.
Sourcepub const fn generation(self) -> u32
pub const fn generation(self) -> u32
Returns the generation count of this ID.
Trait Implementations§
Source§impl Clone for GlobalEventId
impl Clone for GlobalEventId
Source§fn clone(&self) -> GlobalEventId
fn clone(&self) -> GlobalEventId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GlobalEventId
impl Debug for GlobalEventId
Source§impl Default for GlobalEventId
impl Default for GlobalEventId
Source§fn default() -> GlobalEventId
fn default() -> GlobalEventId
Returns the “default value” for a type. Read more
Source§impl Hash for GlobalEventId
impl Hash for GlobalEventId
Source§impl Ord for GlobalEventId
impl Ord for GlobalEventId
Source§fn cmp(&self, other: &GlobalEventId) -> Ordering
fn cmp(&self, other: &GlobalEventId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GlobalEventId
impl PartialEq for GlobalEventId
Source§impl PartialOrd for GlobalEventId
impl PartialOrd for GlobalEventId
impl Copy for GlobalEventId
impl Eq for GlobalEventId
impl StructuralPartialEq for GlobalEventId
Auto Trait Implementations§
impl Freeze for GlobalEventId
impl RefUnwindSafe for GlobalEventId
impl Send for GlobalEventId
impl Sync for GlobalEventId
impl Unpin for GlobalEventId
impl UnwindSafe for GlobalEventId
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§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
Compare self to
key
and return true
if they are equal.