tackt/
error.rs

1/// Error returned when a route does not match.
2#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
3pub enum Error {
4    /// Route path does not match.
5    Path,
6    /// Route method does not match.
7    Method,
8    /// Route prefix does not match.
9    Prefix,
10}
11
12impl std::error::Error for Error {}
13
14impl std::fmt::Display for Error {
15    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16        match self {
17            Error::Path => f.write_str("route path does not match"),
18            Error::Method => f.write_str("route method does not match"),
19            Error::Prefix => f.write_str("route prefix does not match"),
20        }
21    }
22}