#[non_exhaustive]pub enum Error {
Malformed {
expected: &'static str,
reason: &'static str,
},
NewerFormat {
kind: &'static str,
found: u8,
},
WrongKey {
expected: KeyId,
found: KeyId,
},
Inauthentic,
WrongPassphrase,
Parameters(String),
Random,
}Expand description
What can go wrong sealing, opening, locking or unlocking.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Malformed
The bytes are not a blob of the expected kind: too short, too long, or with another first byte.
Fields
NewerFormat
The blob is of a format version this release does not know - written by a newer one.
WrongKey
The blob was sealed under another key; it names that key.
Fields
Inauthentic
The blob does not open under this key and this context: it was sealed for another context, or changed after sealing. The two cannot be told apart, and this error does not try.
WrongPassphrase
The lock does not open with this passphrase: the passphrase is wrong, the context is another one, or the lock was changed. Indistinguishable on purpose.
Parameters(String)
Argon2id parameters outside what this release accepts.
Random
The operating system could not supply random bytes.
Trait Implementations§
impl Eq for Error
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()