1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use chrono;
use subtle_encoding;
#[derive(Copy, Clone, Eq, PartialEq, Debug, Fail)]
pub enum Error {
#[fail(display = "length error")]
Length,
#[fail(display = "parse error")]
Parse,
#[fail(display = "value out of range")]
OutOfRange,
}
impl From<chrono::ParseError> for Error {
fn from(_: chrono::ParseError) -> Error {
Error::Parse
}
}
impl From<subtle_encoding::Error> for Error {
fn from(_: subtle_encoding::Error) -> Error {
Error::Parse
}
}