9 stable releases

2.0.5 Mar 25, 2023
2.0.3 Jan 3, 2023
2.0.0 Dec 29, 2022
1.0.5 Dec 28, 2022

#908 in Web programming

23 downloads per month

AGPL-3.0

19KB
468 lines

iceportal_rs

Fetch data from the iceportal api in a train

Install

cargo add iceportal

Using

Look to the documentation to see response structs.

Status query

Make a request to the /api1/rs/status api.

use iceportal::ICEPortal;

let status_response = ICEPortal::fetch_status().await.unwrap();
println!("{:?}", status_response);

BAP (Bestellen am Platz) query

Make a request to the /bap/api/bap-service-status api.

use iceportal::ICEPortal;

let bap_response = ICEPortal::fetch_bap().await.unwrap();
println!("{:?}", bap_response);

Trip info query

Make a request to the /api1/rs/tripInfo/trip api.

use iceportal::ICEPortal;

let trip_info_response = ICEPortal::fetch_trip_info().await.unwrap();
println!("{:?}", trip_info_response);

Connection query

Make a request to the /api1/rs/tripInfo/connection/EVA_NUMBER api.

use iceportal::ICEPortal;

let eva_nr = "8073368";
let connection_response = ICEPortal::fetch_connection(eva_nr).await.unwrap();
println!("{:?}", connection_response);

Dependencies

~5–18MB
~262K SLoC