pub struct Error {
pub kind: ErrorKind,
pub message: String,
}
Expand description
An error that can occur during JWS processing.
An error consists of an ErrorKind
indicating the type of error,
and a human readable message.
The message is purely for human consumption. It should not be used by error handling code to change handling logic.
Fields§
§kind: ErrorKind
§message: String
Implementations§
source§impl Error
impl Error
pub const Other: ErrorKind = ErrorKind::Other
pub const MissingHeaderParam: ErrorKind = ErrorKind::MissingHeaderParam
pub const InvalidHeaderParam: ErrorKind = ErrorKind::InvalidHeaderParam
pub const UnsupportedMacAlgorithm: ErrorKind = ErrorKind::UnsupportedMacAlgorithm
pub const InvalidMessage: ErrorKind = ErrorKind::InvalidMessage
pub const InvalidSignature: ErrorKind = ErrorKind::InvalidSignature
sourcepub fn other(message: impl Into<String>) -> Self
pub fn other(message: impl Into<String>) -> Self
Create a new error of type ErrorKind::Other
with a given message.
sourcepub fn missing_header_param(message: impl Into<String>) -> Self
pub fn missing_header_param(message: impl Into<String>) -> Self
Create a new error of type ErrorKind::MissingHeaderParam
with a given message.
sourcepub fn invalid_header_param(message: impl Into<String>) -> Self
pub fn invalid_header_param(message: impl Into<String>) -> Self
Create a new error of type ErrorKind::InvalidHeaderParam
with a given message.
sourcepub fn unsupported_mac_algorithm(message: impl Into<String>) -> Self
pub fn unsupported_mac_algorithm(message: impl Into<String>) -> Self
Create a new error of type ErrorKind::UnsupportedMacAlgorithm
with a given message.
sourcepub fn invalid_message(message: impl Into<String>) -> Self
pub fn invalid_message(message: impl Into<String>) -> Self
Create a new error of type ErrorKind::InvalidMessage
with a given message.
sourcepub fn invalid_signature(message: impl Into<String>) -> Self
pub fn invalid_signature(message: impl Into<String>) -> Self
Create a new error of type ErrorKind::InvalidSignature
with a given message.
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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