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
/// The preprocessing algorithm used by an OSRM dataset.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Algorithm {
    /// Multi-Level Dijkstra (`osrm-partition` followed by `osrm-customize`).
    MLD,
    /// Contraction Hierarchies (`osrm-contract`).
    CH,
}

impl Algorithm {
    pub const fn as_str(self) -> &'static str {
        match self {
            Algorithm::MLD => "MLD",
            Algorithm::CH => "CH",
        }
    }
}