pub struct StopTimeEvent {
pub delay: Option<i32>,
pub time: Option<i64>,
pub uncertainty: Option<i32>,
pub scheduled_time: Option<i64>,
}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.
scheduled_time: Option<i64>Scheduled time for a NEW, REPLACEMENT, or DUPLICATED trip. In Unix time (i.e., number of seconds since January 1st 1970 00:00:00 UTC). Optional if TripUpdate.schedule_relationship is NEW, REPLACEMENT or DUPLICATED, forbidden otherwise. NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
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.
Sourcepub fn scheduled_time(&self) -> i64
pub fn scheduled_time(&self) -> i64
Returns the value of scheduled_time, or the default value if scheduled_time 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 · 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<'de> Deserialize<'de> for StopTimeEvent
impl<'de> Deserialize<'de> for StopTimeEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for StopTimeEvent
impl Hash 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(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
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(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
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(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.