10 stable releases

new 3.0.0 Dec 8, 2024
2.0.5 Mar 25, 2023
2.0.3 Jan 3, 2023
2.0.0 Dec 29, 2022
1.0.5 Dec 28, 2022

#733 in Web programming

Download history 16/week @ 2024-09-23 67/week @ 2024-12-02

67 downloads per month

AGPL-3.0

19KB
506 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–17MB
~216K SLoC