Rust API client for Valhalla
This crate contains the types and functions for interacting with the Valhalla API.
These APIs are implemented:
- Turn-by-Turn Route
- Optimized Route
- Time-Distance Matrix
- Isochrone & Isodistance
- Map Matching
- Valhalla locate
- Elevation
- Expansion
- Status
Features and usage
We provide two clients:
- async:
valhalla_client::Valhallaand - sync:
valhalla_client::blocking::Valhallausing the tokio runtime internally to call the async version
The second one is behind the (default-enabled) blocking feature, so if you don't need it, you can disable it via default-features = false.
We also offer the (default-enabled) gpx feature.
This enables reading and writing GPX (GPS Exchange Format) files for APIs where we have the needed context.
Example
// an async version is available at valhalla_client::Valhalla
use Valhalla;
use ;
use ;
let valhalla = default;
let amsterdam = new;
let utrecht = new;
let manifest = builder
.locations
.costing;
let response = valhalla.route.unwrap;
println!;
// If the gpx feature is enabled, you can convert the response to a gpx::Gpx object
// let gpx = response.trip.into();
For further examples, please see the different clients:
- async:
valhalla_client::Valhallaand - sync:
valhalla_client::blocking::Valhalla