airlab_lib/token/
error.rs1use serde::Serialize;
2
3pub type Result<T> = core::result::Result<T, Error>;
4
5#[derive(Debug, Serialize)]
6pub enum Error {
7 HmacFailNewFromSlice,
8
9 InvalidFormat,
10 CannotDecodeIdent,
11 CannotDecodeExp,
12 SignatureNotMatching,
13 ExpNotIso,
14 Expired,
15}
16
17impl core::fmt::Display for Error {
18 fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error> {
19 write!(fmt, "{self:?}")
20 }
21}
22
23impl std::error::Error for Error {}