diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-02-23 22:35:08 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-02-23 22:35:08 +0100 |
commit | 2feeca134368f128e2133adc4be91d9bd17c0dc5 (patch) | |
tree | 49e5652a7002c6f68fceaa842e06f500adb7b3a5 /src/station.rs | |
parent | f1b68ffc0f539b7782ed5cc593cbebc360fe4791 (diff) | |
download | oslobike-2feeca134368f128e2133adc4be91d9bd17c0dc5.tar.gz oslobike-2feeca134368f128e2133adc4be91d9bd17c0dc5.tar.bz2 oslobike-2feeca134368f128e2133adc4be91d9bd17c0dc5.zip |
Add api to fetch availability data as well.
Diffstat (limited to 'src/station.rs')
-rw-r--r-- | src/station.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/station.rs b/src/station.rs index 1d52fb4..49f2cd1 100644 --- a/src/station.rs +++ b/src/station.rs @@ -30,3 +30,21 @@ pub struct Station { pub(crate) struct StationContainer { pub stations: Vec<Station> } + + +#[derive(Debug, Deserialize)] +pub struct Availability { + pub bikes: i16, + pub locks: i16, +} + +#[derive(Debug, Deserialize)] +pub struct StationAvailability { + pub id: usize, + pub availability: Availability, +} + +#[derive(Debug, Deserialize)] +pub(crate) struct StationAvailabilityContainer { + pub stations: Vec<StationAvailability>, +} |