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

source

pub fn is_signature_error(&self) -> bool

Returns true if the error is a signature error.

source

pub fn is_jwt_error(&self) -> bool

Returns true if the error is a JWT error.

source

pub fn is_issuer_error(&self) -> bool

Returns true if the error is an issuer error.

source

pub fn is_expiration_error(&self) -> bool

Returns true if the error is an expiration error.

source

pub fn is_audience_error(&self) -> bool

Returns true if the error is an audience error.

source

pub fn is_format_error(&self) -> bool

Returns true if the error is a format error.

source

pub fn is_invalid_length_error(&self) -> bool

Returns true if the error is a header error.

source

pub fn is_io_error(&self) -> bool

Returns true if the error is an IO error.

source

pub fn is_openssl_error(&self) -> bool

Returns true if the error is an Open SSL error.

source

pub fn is_protocol_error(&self) -> bool

Returns true if the error is a protocol error.

source

pub fn is_token_not_found_error(&self) -> bool

Returns true if the error is a token not found error.

source

pub fn is_base64_error(&self) -> bool

Returns true if the error is an invalid base 64.

Trait Implementations§

source§

impl Clone for JwtError

source§

fn clone(&self) -> JwtError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for JwtError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for JwtError

source§

fn default() -> JwtError

Returns the “default value” for a type. Read more
source§

impl Display for JwtError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

The formatted error.

source§

impl Error for JwtError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<DecodeError> for JwtError

source§

fn from(error: DecodeError) -> JwtError

Converts a DecodeError to a JwtError.

source§

impl From<Error> for JwtError

source§

fn from(error: Error) -> JwtError

Converts to this type from the input type.
source§

impl From<Error> for JwtError

source§

fn from(error: Error) -> JwtError

Converts to this type from the input type.
source§

impl From<InvalidLength> for JwtError

source§

fn from(error: InvalidLength) -> JwtError

Converts to this type from the input type.
source§

impl Hash for JwtError

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for JwtError

source§

fn cmp(&self, other: &JwtError) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for JwtError

source§

fn eq(&self, other: &JwtError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for JwtError

source§

fn partial_cmp(&self, other: &JwtError) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for JwtError

source§

impl StructuralEq for JwtError

source§

impl StructuralPartialEq for JwtError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V