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: StringImplementations§
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)>
Returns 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 Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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