pub struct TargetedEventId(/* private fields */);Expand description
Lightweight identifier for a targeted 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 TargetedEventId
impl TargetedEventId
Sourcepub const NULL: TargetedEventId
pub const NULL: TargetedEventId
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<TargetedEventId>
pub const fn new(index: u32, generation: u32) -> Option<TargetedEventId>
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) -> TargetedEventIdx
pub const fn index(self) -> TargetedEventIdx
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 TargetedEventId
impl Clone for TargetedEventId
Source§fn clone(&self) -> TargetedEventId
fn clone(&self) -> TargetedEventId
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 TargetedEventId
impl Debug for TargetedEventId
Source§impl Default for TargetedEventId
impl Default for TargetedEventId
Source§fn default() -> TargetedEventId
fn default() -> TargetedEventId
Returns the “default value” for a type. Read more
Source§impl Hash for TargetedEventId
impl Hash for TargetedEventId
Source§impl Ord for TargetedEventId
impl Ord for TargetedEventId
Source§fn cmp(&self, other: &TargetedEventId) -> Ordering
fn cmp(&self, other: &TargetedEventId) -> 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 TargetedEventId
impl PartialEq for TargetedEventId
Source§impl PartialOrd for TargetedEventId
impl PartialOrd for TargetedEventId
impl Copy for TargetedEventId
impl Eq for TargetedEventId
impl StructuralPartialEq for TargetedEventId
Auto Trait Implementations§
impl Freeze for TargetedEventId
impl RefUnwindSafe for TargetedEventId
impl Send for TargetedEventId
impl Sync for TargetedEventId
impl Unpin for TargetedEventId
impl UnwindSafe for TargetedEventId
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.