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: StringThe human readable route name of this train.
§Examples:
- “Keystone” (for the Keystone Corridor)
- “Northeast Regional” (for the Northeast Corridor)
train_num: StringThe (possible unique) number identifying the train.
train_id: StringThe concatenation of the train_num with another number (not sure
what exactly) in the format “{:train_num}-{:instance}”.
§Examples:
6-493-4
lat: f64The current latitude of the train
lon: f64The current longitude of the train
train_timely: StringThe human readable status of the timelyness of the train.
§Examples:
X Minutes EarlyX Hours, Y Minutes EarlyX Minutes LateX Hours, Y Minutes LateOn TimeUnknownNaN 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: HeadingThe current compass heading of the train.
event_code: StringUnsure 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: StringThe station code where the train originated from (aka the first station in this train’s route).
§Examples:
PHLNYP
origin_tz: String§origin_name: StringThe full human readable name of the station where the train originated from (aka the first station in this train’s route).
§Examples:
Philadelphia 30th StreetNew York Penn
destination_code: StringThe station code where the train is heading to (aka the final destination of the train).
§Examples:
PHLNYP
destination_tz: String§destination_name: StringThe full human readable name of the station where the train is heading (aka the final destination of the train).
§Examples:
Philadelphia 30th StreetNew York Penn
train_state: TrainStateThe current state of the train
velocity: f32The 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:002023-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:002023-09-04T07:00:00-05:00
last_value: DateTime<FixedOffset>Unsure of what this field symbolizes.
object_id: u32Unsure of what this field symbolizes.