Crates.io | iceportal |
lib.rs | iceportal |
version | |
source | src |
created_at | 2022-12-28 21:16:30.551723 |
updated_at | 2024-12-08 19:57:43.051755 |
description | Fetch data from the iceportal api in a train |
homepage | |
repository | https://github.com/AdriDevelopsThings/iceportal_rs |
max_upload_size | |
id | 746989 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Fetch data from the iceportal api in a train
cargo add iceportal
Look to the documentation to see response structs.
Make a request to the /api1/rs/status
api.
use iceportal::ICEPortal;
let status_response = ICEPortal::fetch_status().await.unwrap();
println!("{:?}", status_response);
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);
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);
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);