pub enum JwtValidationResult<T> {
Valid(JwtClaims<T>),
InvalidToken,
InvalidIssuer {
expected: String,
actual: String,
},
}Expand description
Result of validating a JWT token.
This type separates successful validation from the two expected failure categories exposed by this crate:
- the token could not be decoded or validated
- the token decoded successfully but did not match the expected issuer
Variants§
Valid(JwtClaims<T>)
Token is valid and contains decoded claims.
InvalidToken
Token could not be decoded or failed JWT validation.
This includes malformed tokens and tokens rejected by the configured JWT validation settings.
InvalidIssuer
Token decoded successfully but has the wrong issuer.
Trait Implementations§
Source§impl<T: Clone> Clone for JwtValidationResult<T>
impl<T: Clone> Clone for JwtValidationResult<T>
Source§fn clone(&self) -> JwtValidationResult<T>
fn clone(&self) -> JwtValidationResult<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for JwtValidationResult<T>
impl<T: Debug> Debug for JwtValidationResult<T>
Source§impl<T: PartialEq> PartialEq for JwtValidationResult<T>
impl<T: PartialEq> PartialEq for JwtValidationResult<T>
Source§fn eq(&self, other: &JwtValidationResult<T>) -> bool
fn eq(&self, other: &JwtValidationResult<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Eq> Eq for JwtValidationResult<T>
impl<T> StructuralPartialEq for JwtValidationResult<T>
Auto Trait Implementations§
impl<T> Freeze for JwtValidationResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for JwtValidationResult<T>where
T: RefUnwindSafe,
impl<T> Send for JwtValidationResult<T>where
T: Send,
impl<T> Sync for JwtValidationResult<T>where
T: Sync,
impl<T> Unpin for JwtValidationResult<T>where
T: Unpin,
impl<T> UnsafeUnpin for JwtValidationResult<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for JwtValidationResult<T>where
T: UnwindSafe,
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