pub struct GTFSRealtimeReader {
pub header: GTFSRealtimeHeader,
pub entities: Vec<GTFSRealtimeEntity>,
}Expand description
§GTFS Realtime message.
§Description
The input is a Uint8Array that has encoded protobuffer messages. See https://open-s2.github.io/pbf/classes/PbfReader.html.
The contents of a feed message. A feed is a continuous stream of feed messages. Each message in the stream is obtained as a response to an appropriate HTTP GET request. A realtime feed is always defined with relation to an existing GTFS feed. All the entity ids are resolved with respect to the GTFS feed. Note that “required” and “optional” as stated in this file refer to Protocol Buffer cardinality, not semantic cardinality. See reference.md at https://github.com/google/transit/tree/master/gtfs-realtime for field semantic cardinality.
§Usage
The methods you have access to:
GTFSRealtimeReader::new: Create a new GTFSRealtimeReader
use gistools::readers::GTFSRealtimeReader;
use std::path::PathBuf;
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("tests/readers/gtfs/fixtures/vehicle_position.pb");
let data = std::fs::read(path).unwrap();
let reader = GTFSRealtimeReader::new(data, None);
let entities = &reader.entities;
assert_eq!(entities.len(), 1);§Links
Fields§
§header: GTFSRealtimeHeaderThe header of the message
entities: Vec<GTFSRealtimeEntity>The entities in the message
Implementations§
Trait Implementations§
Source§impl Clone for GTFSRealtimeReader
impl Clone for GTFSRealtimeReader
Source§fn clone(&self) -> GTFSRealtimeReader
fn clone(&self) -> GTFSRealtimeReader
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GTFSRealtimeReader
impl Debug for GTFSRealtimeReader
Source§impl Default for GTFSRealtimeReader
impl Default for GTFSRealtimeReader
Source§fn default() -> GTFSRealtimeReader
fn default() -> GTFSRealtimeReader
Source§impl PartialEq for GTFSRealtimeReader
impl PartialEq for GTFSRealtimeReader
Source§impl ProtoRead for GTFSRealtimeReader
Read in the contents of the GTFSRealtimeReader
impl ProtoRead for GTFSRealtimeReader
Read in the contents of the GTFSRealtimeReader
impl StructuralPartialEq for GTFSRealtimeReader
Auto Trait Implementations§
impl Freeze for GTFSRealtimeReader
impl RefUnwindSafe for GTFSRealtimeReader
impl Send for GTFSRealtimeReader
impl Sync for GTFSRealtimeReader
impl Unpin for GTFSRealtimeReader
impl UnwindSafe for GTFSRealtimeReader
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().