Skip to main content

elevator_core/
stop.rs

1//! Stop identifiers and configuration.
2
3use serde::{Deserialize, Serialize};
4
5/// Numeric identifier for a stop along the shaft.
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
7pub struct StopId(pub u32);
8
9impl std::fmt::Display for StopId {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        write!(f, "StopId({})", self.0)
12    }
13}
14
15/// A stop at an arbitrary position along the elevator shaft.
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct StopConfig {
18    /// The unique identifier for this stop.
19    pub id: StopId,
20    /// Human-readable name for this stop.
21    pub name: String,
22    /// Absolute position along the shaft axis (distance units from origin).
23    pub position: f64,
24}