#[repr(transparent)]pub struct RiderId(pub EntityId);Expand description
Typed wrapper around EntityId for rider entities.
Tuple Fields§
§0: EntityIdImplementations§
Source§impl RiderId
impl RiderId
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<'de> Deserialize<'de> for RiderId
impl<'de> Deserialize<'de> for RiderId
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 From<EntityId> for RiderId
impl From<EntityId> for RiderId
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.
impl Copy for RiderId
impl Eq for RiderId
impl StructuralPartialEq for RiderId
Auto Trait Implementations§
impl Freeze for RiderId
impl RefUnwindSafe for RiderId
impl Send for RiderId
impl Sync for RiderId
impl Unpin for RiderId
impl UnsafeUnpin for RiderId
impl UnwindSafe for RiderId
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.