Enum mini_functions::errors::jwt::JwtError
source · pub enum JwtError {
Show 16 variants
AudienceInvalid(String),
DecodeError(String),
ExpirationInvalid(String),
FormatInvalid(String),
InvalidHeader(String),
InvalidPayload(String),
InvalidSignature(String),
InvalidLength(String),
IoError(String),
IssuerInvalid(String),
JWTInvalid(String),
OpenSslError(String),
ProtocolError(String),
SignatureExpired(String),
SignatureInvalid(String),
TokenNotFound(String),
}
Expand description
Custom error type for JWT. This type is used to represent all
possible errors that can occur when working with JWTs. It is
implemented as an enum with variants for each possible error. It
also implements the Default
, Display
, and Error
traits.
Variants§
AudienceInvalid(String)
The Audience is invalid.
DecodeError(String)
Decode error.
ExpirationInvalid(String)
Expiration is invalid.
FormatInvalid(String)
Format is invalid
InvalidHeader(String)
Invalid header.
InvalidPayload(String)
Invalid payload.
InvalidSignature(String)
Invalid signature
InvalidLength(String)
Invalid length
IoError(String)
IO error.
IssuerInvalid(String)
Issuer is invalid.
JWTInvalid(String)
JWT is invalid.
OpenSslError(String)
Open SSL error.
ProtocolError(String)
Protocol error.
SignatureExpired(String)
Signature is expired.
SignatureInvalid(String)
Signature is invalid.
TokenNotFound(String)
Token not found.
Implementations§
source§impl JwtError
impl JwtError
sourcepub fn is_signature_error(&self) -> bool
pub fn is_signature_error(&self) -> bool
Returns true
if the error is a signature error.
sourcepub fn is_jwt_error(&self) -> bool
pub fn is_jwt_error(&self) -> bool
Returns true
if the error is a JWT error.
sourcepub fn is_issuer_error(&self) -> bool
pub fn is_issuer_error(&self) -> bool
Returns true
if the error is an issuer error.
sourcepub fn is_expiration_error(&self) -> bool
pub fn is_expiration_error(&self) -> bool
Returns true
if the error is an expiration error.
sourcepub fn is_audience_error(&self) -> bool
pub fn is_audience_error(&self) -> bool
Returns true
if the error is an audience error.
sourcepub fn is_format_error(&self) -> bool
pub fn is_format_error(&self) -> bool
Returns true
if the error is a format error.
sourcepub fn is_invalid_length_error(&self) -> bool
pub fn is_invalid_length_error(&self) -> bool
Returns true
if the error is a header error.
sourcepub fn is_io_error(&self) -> bool
pub fn is_io_error(&self) -> bool
Returns true
if the error is an IO error.
sourcepub fn is_openssl_error(&self) -> bool
pub fn is_openssl_error(&self) -> bool
Returns true
if the error is an Open SSL error.
sourcepub fn is_protocol_error(&self) -> bool
pub fn is_protocol_error(&self) -> bool
Returns true
if the error is a protocol error.
sourcepub fn is_token_not_found_error(&self) -> bool
pub fn is_token_not_found_error(&self) -> bool
Returns true
if the error is a token not found error.
sourcepub fn is_base64_error(&self) -> bool
pub fn is_base64_error(&self) -> bool
Returns true
if the error is an invalid base 64.
Trait Implementations§
source§impl Error for JwtError
impl Error for JwtError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl Ord for JwtError
impl Ord for JwtError
source§impl PartialEq for JwtError
impl PartialEq for JwtError
source§impl PartialOrd for JwtError
impl PartialOrd for JwtError
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for JwtError
impl StructuralEq for JwtError
impl StructuralPartialEq for JwtError
Auto Trait Implementations§
impl RefUnwindSafe for JwtError
impl Send for JwtError
impl Sync for JwtError
impl Unpin for JwtError
impl UnwindSafe for JwtError
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
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.