routee-compass-core 0.7.0

The core routing algorithms and data structures of the RouteE-Compass energy-aware routing engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::{Distance, DistanceUnit, Speed, SpeedUnit, Time};

#[derive(thiserror::Error, Debug)]
pub enum UnitError {
    #[error("unable to parse {0} as a number")]
    NumericParsingError(String),
    #[error("{0} is an invalid speed, must be strictly positive (0, +inf]")]
    InvalidSpeed(f64),
    #[error("cannot create speed from time {0} and distance {0}")]
    SpeedFromTimeAndDistanceError(Time, Distance),
    #[error("cannot create time from speed {0} {1} and distance {2} {3}")]
    TimeFromSpeedAndDistanceError(Speed, SpeedUnit, Distance, DistanceUnit),
}