Struct gtfs_rt::VehiclePosition
source · pub struct VehiclePosition {
pub trip: Option<TripDescriptor>,
pub vehicle: Option<VehicleDescriptor>,
pub position: Option<Position>,
pub current_stop_sequence: Option<u32>,
pub stop_id: Option<String>,
pub current_status: Option<i32>,
pub timestamp: Option<u64>,
pub congestion_level: Option<i32>,
pub occupancy_status: Option<i32>,
}
Expand description
Realtime positioning information for a given vehicle.
Fields§
§trip: Option<TripDescriptor>
The Trip that this vehicle is serving. Can be empty or partial if the vehicle can not be identified with a given trip instance.
vehicle: Option<VehicleDescriptor>
Additional information on the vehicle that is serving this trip.
position: Option<Position>
Current position of this vehicle.
current_stop_sequence: Option<u32>
The stop sequence index of the current stop. The meaning of current_stop_sequence (i.e., the stop that it refers to) is determined by current_status. If current_status is missing IN_TRANSIT_TO is assumed.
stop_id: Option<String>
Identifies the current stop. The value must be the same as in stops.txt in the corresponding GTFS feed.
current_status: Option<i32>
The exact status of the vehicle with respect to the current stop. Ignored if current_stop_sequence is missing.
timestamp: Option<u64>
Moment at which the vehicle’s position was measured. In POSIX time (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
congestion_level: Option<i32>
§occupancy_status: Option<i32>
Implementations§
source§impl VehiclePosition
impl VehiclePosition
pub fn current_stop_sequence(&self) -> u32
pub fn current_status(&self) -> VehicleStopStatus
pub fn set_current_status(&mut self, value: VehicleStopStatus)
pub fn timestamp(&self) -> u64
pub fn congestion_level(&self) -> CongestionLevel
pub fn set_congestion_level(&mut self, value: CongestionLevel)
pub fn stop_id(&self) -> &str
pub fn occupancy_status(&self) -> OccupancyStatus
pub fn set_occupancy_status(&mut self, value: OccupancyStatus)
Trait Implementations§
source§impl Clone for VehiclePosition
impl Clone for VehiclePosition
source§fn clone(&self) -> VehiclePosition
fn clone(&self) -> VehiclePosition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VehiclePosition
impl Debug for VehiclePosition
source§impl Default for VehiclePosition
impl Default for VehiclePosition
source§fn default() -> VehiclePosition
fn default() -> VehiclePosition
source§impl Message for VehiclePosition
impl Message for VehiclePosition
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: IntoBuf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: IntoBuf,
Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: IntoBuf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: IntoBuf,
Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: IntoBuf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: IntoBuf,
Self: Sized,
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: IntoBuf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: IntoBuf,
Self: Sized,
self
. Read more