pub struct Train {Show 24 fields
pub route_name: String,
pub train_num: String,
pub train_id: String,
pub lat: f64,
pub lon: f64,
pub train_timely: String,
pub stations: Vec<TrainStation>,
pub heading: Heading,
pub event_code: String,
pub event_tz: Option<String>,
pub event_name: Option<String>,
pub origin_code: String,
pub origin_tz: String,
pub origin_name: String,
pub destination_code: String,
pub destination_tz: String,
pub destination_name: String,
pub train_state: TrainState,
pub velocity: f32,
pub status_message: String,
pub created_at: DateTime<FixedOffset>,
pub updated_at: DateTime<FixedOffset>,
pub last_value: DateTime<FixedOffset>,
pub object_id: u32,
}
Expand description
Represents an Amtrak train
Fields§
§route_name: String
The human readable route name of this train.
§Examples:
- “Keystone” (for the Keystone Corridor)
- “Northeast Regional” (for the Northeast Corridor)
train_num: String
The (possible unique) number identifying the train.
train_id: String
The concatenation of the train_num
with another number (not sure
what exactly) in the format “{:train_num}-{:instance}”.
§Examples:
6-4
93-4
lat: f64
The current latitude of the train
lon: f64
The current longitude of the train
train_timely: String
The human readable status of the timelyness of the train.
§Examples:
X Minutes Early
X Hours, Y Minutes Early
X Minutes Late
X Hours, Y Minutes Late
On Time
Unknown
NaN Minutes Early
(yes really)
stations: Vec<TrainStation>
List of stations that the train will visit. The stations are listed in the same order the train will stop at each.
heading: Heading
The current compass heading of the train.
event_code: String
Unsure of what this field symbolizes.
event_tz: Option<String>
Unsure of what this field symbolizes.
event_name: Option<String>
Unsure of what this field symbolizes.
origin_code: String
The station code where the train originated from (aka the first station in this train’s route).
§Examples:
PHL
NYP
origin_tz: String
§origin_name: String
The full human readable name of the station where the train originated from (aka the first station in this train’s route).
§Examples:
Philadelphia 30th Street
New York Penn
destination_code: String
The station code where the train is heading to (aka the final destination of the train).
§Examples:
PHL
NYP
destination_tz: String
§destination_name: String
The full human readable name of the station where the train is heading (aka the final destination of the train).
§Examples:
Philadelphia 30th Street
New York Penn
train_state: TrainState
The current state of the train
velocity: f32
The current velocity (in mph) of the train
status_message: String
§created_at: DateTime<FixedOffset>
The time at which this train entry was created. The entry will have the local timezone as a fixed offset.
§Examples:
2023-09-04T07:46:06-04:00
2023-09-04T07:00:00-05:00
updated_at: DateTime<FixedOffset>
The time at which this train entry was last updated. The entry will have the local timezone as a fixed offset.
§Examples:
2023-09-04T07:46:06-04:00
2023-09-04T07:00:00-05:00
last_value: DateTime<FixedOffset>
Unsure of what this field symbolizes.
object_id: u32
Unsure of what this field symbolizes.