-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic.rs
33 lines (24 loc) · 860 Bytes
/
basic.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use kvv_efa_api::{self, request::{DepartureMonitorRequest, Request, StopFinderRequest}};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
{
// Search the station table for "Hauptbahnhof"
let request = StopFinderRequest::builder()
.name("Bretten Bahnhof")
.build();
println!("Requesting {}...", request.url());
let response = request.get().await?;
println!("response: {:#?}", response);
}
{
// Fetch the departures of station 7000801 ("Durlach Bahnhof")
let request = DepartureMonitorRequest::builder()
.name(7000801)
.limit(4)
.build();
println!("Requesting {}...", request.url());
let response = request.get().await?;
println!("response: {:#?}", response);
}
Ok(())
}