5 releases (3 breaking)

0.4.0 Mar 15, 2025
0.3.0 Feb 16, 2025
0.2.0 Dec 25, 2024
0.1.1 Jul 14, 2023
0.1.0 Jul 11, 2023

#259 in Web programming

Download history 13/week @ 2024-12-08 11/week @ 2024-12-15 169/week @ 2024-12-22 22/week @ 2024-12-29 46/week @ 2025-01-05 4/week @ 2025-01-12 5/week @ 2025-01-19 2/week @ 2025-02-02 1/week @ 2025-02-09 133/week @ 2025-02-16 21/week @ 2025-02-23 17/week @ 2025-03-02 116/week @ 2025-03-09 112/week @ 2025-03-16

274 downloads per month

Apache-2.0

210KB
3K SLoC

Rust API client for Valhalla

This crate contains the types and functions for interacting with the Valhalla API.

These APIs are implemented:

Features and usage

We provide two clients:

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_client::blocking::Valhalla;
use valhalla_client::route::{Location, Manifest};
use valhalla_client::costing::{Costing};

let valhalla = Valhalla::default();

let amsterdam = Location::new(4.9041, 52.3676);
let utrecht = Location::new(5.1214, 52.0907);
let manifest = Manifest::builder()
    .locations([amsterdam, utrecht])
    .costing(Costing::Motorcycle(Default::default()));

let response = valhalla.route(manifest).unwrap();

println!("{:#?}", response);

// 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:

Dependencies

~8–20MB
~271K SLoC