#[non_exhaustive]pub struct RankContext<'a> {
pub car: EntityId,
pub stop: EntityId,
pub group: &'a ElevatorGroup,
pub manifest: &'a DispatchManifest,
pub world: &'a World,
}Expand description
Context passed to DispatchStrategy::rank.
Bundles the per-call arguments into a single struct so future context fields can be added without breaking existing trait implementations.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.car: EntityIdThe elevator being evaluated.
stop: EntityIdThe stop being evaluated as a candidate destination.
group: &'a ElevatorGroupThe dispatch group this assignment belongs to.
manifest: &'a DispatchManifestDemand snapshot for the current dispatch pass.
world: &'a WorldRead-only world state.
Implementations§
Source§impl RankContext<'_>
impl RankContext<'_>
Sourcepub fn car_position(&self) -> f64
pub fn car_position(&self) -> f64
Position of car along the shaft axis.
Returns 0.0 for an entity that has no Position component
(which would never reach this method through normal dispatch
— compute_assignments filters out cars without positions
upstream — but the defensive default protects custom callers).
Derived from world on each call: the dispatch
loop never moves elevators between rank calls, so re-deriving
is free, and skipping the duplicate field eliminates the
synchronisation risk of the old shape.
Sourcepub fn stop_position(&self) -> f64
pub fn stop_position(&self) -> f64
Position of stop along the shaft axis.
Returns 0.0 for an entity that has no Stop component (same
rationale as car_position).