pub struct StopTimeEvent {
pub delay: Option<i32>,
pub time: Option<i64>,
pub uncertainty: Option<i32>,
}Expand description
Timing information for a single predicted event (either arrival or departure). Timing consists of delay and/or estimated time, and uncertainty.
- delay should be used when the prediction is given relative to some existing schedule in GTFS.
- time should be given whether there is a predicted schedule or not. If both time and delay are specified, time will take precedence (although normally, time, if given for a scheduled trip, should be equal to scheduled time in GTFS + delay).
Uncertainty applies equally to both time and delay. The uncertainty roughly specifies the expected error in true delay (but note, we don’t yet define its precise statistical meaning). It’s possible for the uncertainty to be 0, for example for trains that are driven under computer timing control.
Fields§
§delay: Option<i32>Delay (in seconds) can be positive (meaning that the vehicle is late) or negative (meaning that the vehicle is ahead of schedule). Delay of 0 means that the vehicle is exactly on time.
time: Option<i64>Event as absolute time. In Unix time (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
uncertainty: Option<i32>If uncertainty is omitted, it is interpreted as unknown. If the prediction is unknown or too uncertain, the delay (or time) field should be empty. In such case, the uncertainty field is ignored. To specify a completely certain prediction, set its uncertainty to 0.
Implementations§
Source§impl StopTimeEvent
impl StopTimeEvent
Sourcepub fn uncertainty(&self) -> i32
pub fn uncertainty(&self) -> i32
Returns the value of uncertainty, or the default value if uncertainty is unset.
Trait Implementations§
Source§impl Clone for StopTimeEvent
impl Clone for StopTimeEvent
Source§fn clone(&self) -> StopTimeEvent
fn clone(&self) -> StopTimeEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StopTimeEvent
impl Debug for StopTimeEvent
Source§impl Default for StopTimeEvent
impl Default for StopTimeEvent
Source§impl Message for StopTimeEvent
impl Message for StopTimeEvent
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.Source§impl PartialEq for StopTimeEvent
impl PartialEq for StopTimeEvent
Source§fn eq(&self, other: &StopTimeEvent) -> bool
fn eq(&self, other: &StopTimeEvent) -> bool
self and other values to be equal, and is used by ==.