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
31
mod actix;
mod claims;
mod config;
mod decode;
mod encode;
mod key;

pub use claims::Jwt;
pub use config::JwtConfig;
pub use decode::JwtDecode;
pub use encode::JwtEncode;

pub use jsonwebtoken::Algorithm;

mod errors {
    use std::io;

    pub(crate) fn invalid_input<E>(error: E) -> io::Error
    where
        E: Into<Box<dyn std::error::Error + Send + Sync>>,
    {
        io::Error::new(io::ErrorKind::InvalidInput, error)
    }

    pub(crate) fn invalid_data<E>(error: E) -> io::Error
    where
        E: Into<Box<dyn std::error::Error + Send + Sync>>,
    {
        io::Error::new(io::ErrorKind::InvalidData, error)
    }
}