Struct amtrak_api::responses::TrainResponse
source · pub struct TrainResponse(pub HashMap<String, Vec<Train>>);Expand description
The response from the /trains or /trains/{:train_id} endpoint.
Tuple Fields§
§0: HashMap<String, Vec<Train>>Each key in the hashmap is the string representation of the
train_num field. The value is a list of trains that have the
specified train_num field. I have not seen an instance where
multiple trains have the same train_num and therefore each list
in the map has only one item. It is possible for multiple trains to
have the same train_num so that case must be handled in the
client code.
Trait Implementations§
source§impl Clone for TrainResponse
impl Clone for TrainResponse
source§fn clone(&self) -> TrainResponse
fn clone(&self) -> TrainResponse
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for TrainResponse
impl Debug for TrainResponse
source§impl<'de> Deserialize<'de> for TrainResponse
impl<'de> Deserialize<'de> for TrainResponse
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for TrainResponse
impl Send for TrainResponse
impl Sync for TrainResponse
impl Unpin for TrainResponse
impl UnwindSafe for TrainResponse
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more