#[repr(transparent)]pub struct ElevatorId(pub EntityId);Expand description
Typed wrapper around EntityId for elevator entities.
Tuple Fields§
§0: EntityIdImplementations§
Source§impl ElevatorId
impl ElevatorId
Sourcepub const fn wrap_unchecked(id: EntityId) -> Self
pub const fn wrap_unchecked(id: EntityId) -> Self
Wrap an EntityId in this typed newtype without verifying
the entity is actually of that kind. Wrong-kind IDs surface
later as EntityNotFound / NotAnElevator from accessor
calls.
The explicit name signals the unsafety that the silent
From<EntityId> impl on this type also exposes — both
constructors are intended for callers that already hold a
confirmed-kind id (typed-ID accessors like
World::elevator_ids,
snapshot deserialization, defense-in-depth tests). At host
boundaries, prefer Simulation::elevator_id
/ Simulation::rider_id,
which return Option after a runtime kind check.
Trait Implementations§
Source§impl Clone for ElevatorId
impl Clone for ElevatorId
Source§fn clone(&self) -> ElevatorId
fn clone(&self) -> ElevatorId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ElevatorId
impl Debug for ElevatorId
Source§impl Default for ElevatorId
impl Default for ElevatorId
Source§impl<'de> Deserialize<'de> for ElevatorId
impl<'de> Deserialize<'de> for ElevatorId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ElevatorId
impl Display for ElevatorId
Source§impl From<ElevatorId> for EntityId
impl From<ElevatorId> for EntityId
Source§fn from(id: ElevatorId) -> Self
fn from(id: ElevatorId) -> Self
Source§impl From<EntityId> for ElevatorId
impl From<EntityId> for ElevatorId
Source§fn from(id: EntityId) -> Self
fn from(id: EntityId) -> Self
Wrap an EntityId in this typed newtype without verifying
the entity is actually of that kind. Wrong-kind IDs surface
later as EntityNotFound / NotAnElevator from accessor
calls. Equivalent to wrap_unchecked;
at host boundaries, prefer the verified
Simulation::elevator_id
/ Simulation::rider_id
accessors, which return Option after a runtime kind check.
Source§impl Hash for ElevatorId
impl Hash for ElevatorId
Source§impl PartialEq for ElevatorId
impl PartialEq for ElevatorId
Source§fn eq(&self, other: &ElevatorId) -> bool
fn eq(&self, other: &ElevatorId) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ElevatorId
impl Serialize for ElevatorId
impl Copy for ElevatorId
impl Eq for ElevatorId
impl StructuralPartialEq for ElevatorId
Auto Trait Implementations§
impl Freeze for ElevatorId
impl RefUnwindSafe for ElevatorId
impl Send for ElevatorId
impl Sync for ElevatorId
impl Unpin for ElevatorId
impl UnsafeUnpin for ElevatorId
impl UnwindSafe for ElevatorId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.