osrm-binding 1.0.0

Safe embedded Rust API for OSRM route, table, and trip services.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Error, Debug)]
#[non_exhaustive]
pub enum OsrmError {
    #[error("Failed to create OSRM instance")]
    Initialization,
    #[error("Sources or destinations are invalid")]
    InvalidTableArgument,
    #[error("A route requires at least two points")]
    InvalidRouteArgument,
    #[error("Invalid trip request: {0}")]
    InvalidTripArgument(String),
    #[error("Failed to parse OSRM response: {0}")]
    JsonParse(#[from] serde_json::Error),
    #[error("Internal FFI error: {0}")]
    FfiError(String),
}