| 1 |
// auto-generated by: jiff-cli generate shared |
| 2 |
|
| 3 |
pub(crate) mod itime; |
| 4 |
|
| 5 |
/// An error scoped to Jiff's `shared` module. |
| 6 |
#[derive(Clone, Debug, Eq, PartialEq)] |
| 7 |
pub struct Error { |
| 8 |
kind: ErrorKind, |
| 9 |
} |
| 10 |
|
| 11 |
impl core::fmt::Display for Error { |
| 12 |
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
| 13 |
self.kind.fmt(f) |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
#[derive(Clone, Debug, Eq, PartialEq)] |
| 18 |
enum ErrorKind { |
| 19 |
Time(self::itime::Error), |
| 20 |
} |
| 21 |
|
| 22 |
impl From<ErrorKind> for Error { |
| 23 |
fn from(kind: ErrorKind) -> Error { |
| 24 |
Error { kind } |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
impl core::fmt::Display for ErrorKind { |
| 29 |
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
| 30 |
match *self { |
| 31 |
ErrorKind::Time(ref err) => err.fmt(f), |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
/* |
| 37 |
/// A slim error that occurs when an input value is out of bounds. |
| 38 |
#[derive(Clone, Debug)] |
| 39 |
struct SlimRangeError { |
| 40 |
what: &'static str, |
| 41 |
} |
| 42 |
|
| 43 |
impl SlimRangeError { |
| 44 |
fn new(what: &'static str) -> SlimRangeError { |
| 45 |
SlimRangeError { what } |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
impl std::error::Error for SlimRangeError {} |
| 50 |
|
| 51 |
impl core::fmt::Display for SlimRangeError { |
| 52 |
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
| 53 |
let SlimRangeError { what } = *self; |
| 54 |
write!(f, "parameter '{what}' is not in the required range") |
| 55 |
} |
| 56 |
} |
| 57 |
*/ |