pub enum Error {
HmacSha256 {
source: InvalidLength,
},
KeyGripEmpty,
Argon2Hash {
source: Error,
},
Argon2Parse {
source: Error,
},
}Variants§
HmacSha256
封装 hmac crate 的 InvalidLength,使调用方可直接使用 .context(HmacSha256Snafu)。
Fields
§
source: InvalidLengthKeyGripEmpty
密钥列表为空,无法执行签名或验签操作。
Argon2Hash
Argon2 哈希计算失败(参数异常,正常不会发生)。
Argon2Parse
解析已存储的 Argon2 PHC 串失败(库中哈希损坏 / 校验阶段内部异常)。
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreAuto 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> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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