pub struct Auth { /* private fields */ }
Implementations§
Source§impl Auth
impl Auth
pub fn new(inner: JWT, config: Auth) -> Self
pub fn try_from_config(config: Auth) -> AuthResult<Self>
pub fn config(self) -> Auth
pub fn check(&self, token: &str) -> AuthResult<UserClaims>
Methods from Deref<Target = JWT>§
pub fn generate_token( &self, uid: String, expiration: u64, claims: Option<Value>, ) -> AuthResult<String>
pub fn validate(&self, token: &str) -> AuthResult<TokenData<UserClaims>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnwindSafe for Auth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more