pub struct HandlerId(/* private fields */);
Expand description
Lightweight identifier for a handler.
Handler identifiers are implemented using an index and a generation count. The generation count ensures that IDs from removed handlers are not reused by new handlers.
A handler identifier is only meaningful in the World
it was created
from. Attempting to use a handler ID in a different world will have
unexpected results.
Implementations§
Source§impl HandlerId
impl HandlerId
Sourcepub const NULL: HandlerId
pub const NULL: HandlerId
The handler ID which never identifies a live handler. This is the
default value for HandlerId
.
Sourcepub const fn index(self) -> HandlerIdx
pub const fn index(self) -> HandlerIdx
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 Ord for HandlerId
impl Ord for HandlerId
Source§impl PartialOrd for HandlerId
impl PartialOrd for HandlerId
impl Copy for HandlerId
impl Eq for HandlerId
impl StructuralPartialEq for HandlerId
Auto Trait Implementations§
impl Freeze for HandlerId
impl RefUnwindSafe for HandlerId
impl Send for HandlerId
impl Sync for HandlerId
impl Unpin for HandlerId
impl UnwindSafe for HandlerId
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.