[][src]Struct trenitalia::Trenitalia

pub struct Trenitalia { /* fields omitted */ }

Methods

impl Trenitalia[src]

pub fn new() -> Trenitalia[src]

Creates a new Trenitalia instance

pub fn find_trips(
    &self,
    from: &TrainStation,
    to: &TrainStation,
    when: &DateTime<Local>
) -> Vec<Vec<TrainTrip>>
[src]

Find a trip between two stations using ViaggiaTreno API and falling back to LeFrecce

pub fn find_train_station_online(&self, name: &str) -> Option<&TrainStation>[src]

Call to the ViaggiaTreno station lookup API

pub fn get_train_station(&self, id: &str) -> Option<&TrainStation>[src]

Return a station object reference that has the requested ID

pub fn find_train_station(&self, name: &str) -> Option<&TrainStation>[src]

Look for a train station

pub fn train_info(&self, number: u32, from: String) -> Result<TrainInfo, &str>[src]

Get train details, provided that you know the originating station

pub fn train_info_calling_at(
    &self,
    number: u32,
    calling_at: &TrainStation
) -> Result<TrainInfo, &str>
[src]

Get train details, knowing that it calls at a certain station

pub fn nearest_station(&self, point: (f64, f64)) -> &TrainStation[src]

Finds the nearest station from a point

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.