| 1 | mod journeysrust-analyzer cargo railway-core 0.3.0 api/journeys/; |
| 2 | mod locationsrust-analyzer cargo railway-core 0.3.0 api/locations/; |
| 3 | mod refresh_journeyrust-analyzer cargo railway-core 0.3.0 api/refresh_journey/; |
| 4 | mod station_boardrust-analyzer cargo railway-core 0.3.0 api/station_board/; |
| 5 | |
| 6 | pub use journeysrust-analyzer cargo railway-core 0.3.0 api/journeys/::*; |
| 7 | pub use locationsrust-analyzer cargo railway-core 0.3.0 api/locations/::*; |
| 8 | pub use refresh_journeyrust-analyzer cargo railway-core 0.3.0 api/refresh_journey/::*; |
| 9 | pub use station_boardrust-analyzer cargo railway-core 0.3.0 api/station_board/::*; |
| 10 | |
| 11 | use craterust-analyzer cargo railway-core 0.3.0 crate/::{Journeyrust-analyzer cargo railway-core 0.3.0 types/Journey#, Placerust-analyzer cargo railway-core 0.3.0 types/Place#, Requesterrust-analyzer cargo railway-core 0.3.0 requester/Requester#}; |
| 12 | use async_traitrust-analyzer cargo async-trait 0.1.85 crate/::async_traitrust-analyzer cargo async-trait 0.1.85 async_trait:; |
| 13 | |
| 14 | /// The core type definition specifying what a provider needs to do. |
| 15 | /// |
| 16 | /// To implement the required methods, a provider usually queries an external but public API. |
| 17 | #[cfg_attr(feature = "rt-multi-thread", async_trait)] |
| 18 | #[cfg_attr(not(feature = "rt-multi-thread"), async_trait(?Send))] |
| 19 | pub trait Providerrust-analyzer cargo railway-core 0.3.0 api/Provider#<R: Requesterrust-analyzer cargo railway-core 0.3.0 requester/Requester#> { |
| 20 | type Errorrust-analyzer cargo railway-core 0.3.0 api/Provider#Error#: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#; |
| 21 | |
| 22 | /// Query a list of journeys. |
| 23 | /// |
| 24 | /// Be careful about timezones! |
| 25 | /// The types given to you are annotated with an arbitrary timezone, your public API may only understand one specific timezone though. |
| 26 | /// Ensure you correctly convert the given timezone to a timezone you require. |
| 27 | /// For returning a date and time, you may choose an arbitrary timezone. |
| 28 | async fn journeysrust-analyzer cargo railway-core 0.3.0 api/Provider#journeys().( |
| 29 | &self, |
| 30 | from: Placerust-analyzer cargo railway-core 0.3.0 types/Place#, |
| 31 | to: Placerust-analyzer cargo railway-core 0.3.0 types/Place#, |
| 32 | opts: JourneysOptionsrust-analyzer cargo railway-core 0.3.0 api/journeys/JourneysOptions#, |
| 33 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<JourneysResponserust-analyzer cargo railway-core 0.3.0 api/journeys/JourneysResponse#, craterust-analyzer cargo railway-core 0.3.0 crate/::Errorrust-analyzer cargo railway-core 0.3.0 error/Error#<R::Errorrust-analyzer cargo railway-core 0.3.0 requester/Requester#Error#, Self::Errorrust-analyzer cargo railway-core 0.3.0 api/Provider#Error#>>; |
| 34 | |
| 35 | /// Autocomplete a location. |
| 36 | /// |
| 37 | /// This takes a query string and should return a list of locations which match the given string. |
| 38 | async fn locationsrust-analyzer cargo railway-core 0.3.0 api/Provider#locations().( |
| 39 | &self, |
| 40 | opts: LocationsOptionsrust-analyzer cargo railway-core 0.3.0 api/locations/LocationsOptions#, |
| 41 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<LocationsResponserust-analyzer cargo railway-core 0.3.0 api/locations/LocationsResponse#, craterust-analyzer cargo railway-core 0.3.0 crate/::Errorrust-analyzer cargo railway-core 0.3.0 error/Error#<R::Errorrust-analyzer cargo railway-core 0.3.0 requester/Requester#Error#, Self::Errorrust-analyzer cargo railway-core 0.3.0 api/Provider#Error#>>; |
| 42 | |
| 43 | /// Query a list of arrivals/departures from a given station. |
| 44 | async fn station_boardrust-analyzer cargo railway-core 0.3.0 api/Provider#station_board().( |
| 45 | &self, |
| 46 | place: Placerust-analyzer cargo railway-core 0.3.0 types/Place#, |
| 47 | kind: StationBoardKindrust-analyzer cargo railway-core 0.3.0 api/station_board/StationBoardKind#, |
| 48 | opts: StationBoardOptionsrust-analyzer cargo railway-core 0.3.0 api/station_board/StationBoardOptions#, |
| 49 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<StationBoardResponserust-analyzer cargo railway-core 0.3.0 api/station_board/StationBoardResponse#, craterust-analyzer cargo railway-core 0.3.0 crate/::Errorrust-analyzer cargo railway-core 0.3.0 error/Error#<R::Errorrust-analyzer cargo railway-core 0.3.0 requester/Requester#Error#, Self::Errorrust-analyzer cargo railway-core 0.3.0 api/Provider#Error#>>; |
| 50 | |
| 51 | /// Refresh a journey. |
| 52 | /// |
| 53 | /// This takes a previously queried journey and refreshes real-time data. |
| 54 | /// A naive implementation may call [`Provider::journeys`] again and return the matching journey, this is a valid strategy if there is no API for refreshing a journey. |
| 55 | async fn refresh_journeyrust-analyzer cargo railway-core 0.3.0 api/Provider#refresh_journey().( |
| 56 | &self, |
| 57 | journey: &Journeyrust-analyzer cargo railway-core 0.3.0 types/Journey#, |
| 58 | opts: RefreshJourneyOptionsrust-analyzer cargo railway-core 0.3.0 api/refresh_journey/RefreshJourneyOptions#, |
| 59 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<RefreshJourneyResponserust-analyzer cargo railway-core 0.3.0 api/refresh_journey/RefreshJourneyResponse#, craterust-analyzer cargo railway-core 0.3.0 crate/::Errorrust-analyzer cargo railway-core 0.3.0 error/Error#<R::Errorrust-analyzer cargo railway-core 0.3.0 requester/Requester#Error#, Self::Errorrust-analyzer cargo railway-core 0.3.0 api/Provider#Error#>>; |
| 60 | } |