#[non_exhaustive]pub enum RiderPhase {
Waiting,
Boarding(EntityId),
Riding(EntityId),
Exiting(EntityId),
Walking,
Arrived,
Abandoned,
Resident,
}Expand description
Lifecycle phase of a rider entity.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Waiting
Waiting at a stop.
Boarding(EntityId)
Boarding an elevator (transient, one tick).
Riding(EntityId)
Riding in an elevator.
Exiting(EntityId)
Exiting an elevator (transient, one tick).
Walking
Walking between transfer stops.
Arrived
Reached final destination.
Abandoned
Gave up waiting.
Resident
Parked at a stop, not seeking an elevator.
Implementations§
Source§impl RiderPhase
impl RiderPhase
Sourcepub const fn is_aboard(&self) -> bool
pub const fn is_aboard(&self) -> bool
True when the rider is currently inside or transitioning through an
elevator cab — i.e., Boarding,
Riding, or Exiting.
Useful for code that needs to treat all three mid-elevator phases
uniformly (rendering, per-elevator population counts, skipping
stop-queue updates) without writing a three-arm match.
Source§impl RiderPhase
impl RiderPhase
Sourcepub const fn kind(&self) -> RiderPhaseKind
pub const fn kind(&self) -> RiderPhaseKind
Return the data-less kind of this phase.
Trait Implementations§
Source§impl Clone for RiderPhase
impl Clone for RiderPhase
Source§fn clone(&self) -> RiderPhase
fn clone(&self) -> RiderPhase
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 RiderPhase
impl Debug for RiderPhase
Source§impl<'de> Deserialize<'de> for RiderPhase
impl<'de> Deserialize<'de> for RiderPhase
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RiderPhase
impl Display for RiderPhase
Source§impl PartialEq for RiderPhase
impl PartialEq for RiderPhase
Source§impl Serialize for RiderPhase
impl Serialize for RiderPhase
impl Copy for RiderPhase
impl Eq for RiderPhase
impl StructuralPartialEq for RiderPhase
Auto Trait Implementations§
impl Freeze for RiderPhase
impl RefUnwindSafe for RiderPhase
impl Send for RiderPhase
impl Sync for RiderPhase
impl Unpin for RiderPhase
impl UnsafeUnpin for RiderPhase
impl UnwindSafe for RiderPhase
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> 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.