#[non_exhaustive]pub enum AgeVaultError {
KeyRead(Error),
KeyParse(String),
VaultRead(Error),
Decrypt(DecryptError),
Io(Error),
Json(Error),
Encrypt(String),
VaultWrite(Error),
KeyWrite(Error),
AlreadyExists(String),
VaultAlreadyExists(PathBuf),
}Expand description
Errors that can occur during age vault operations.
Each variant wraps the underlying cause so callers can match on failure type without parsing error strings.
§Examples
use zeph_vault::AgeVaultError;
let err = AgeVaultError::KeyParse("no identity line found".into());
assert!(err.to_string().contains("failed to parse age identity"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
KeyRead(Error)
The key file could not be read from disk.
KeyParse(String)
The key file content could not be parsed as an age identity.
VaultRead(Error)
The vault file could not be read from disk.
Decrypt(DecryptError)
The age decryption step failed (wrong key, corrupted file, etc.).
Io(Error)
An I/O error occurred while reading plaintext from the age stream.
Json(Error)
The decrypted bytes could not be parsed as JSON.
Encrypt(String)
The age encryption step failed.
VaultWrite(Error)
The vault file (or its temporary predecessor) could not be written to disk.
KeyWrite(Error)
The key file could not be written to disk.
AlreadyExists(String)
AgeVaultProvider::set_secret_mut was called with overwrite: false for a key that
already exists in the vault.
VaultAlreadyExists(PathBuf)
AgeVaultProvider::init_vault (or AgeVaultProvider::init_vault_at) found an
existing vault-key.txt or secrets.age at the target location and force was not
set.
Trait Implementations§
Source§impl Debug for AgeVaultError
impl Debug for AgeVaultError
Source§impl Display for AgeVaultError
impl Display for AgeVaultError
Source§impl Error for AgeVaultError
impl Error for AgeVaultError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for AgeVaultError
impl !UnwindSafe for AgeVaultError
impl Freeze for AgeVaultError
impl Send for AgeVaultError
impl Sync for AgeVaultError
impl Unpin for AgeVaultError
impl UnsafeUnpin for AgeVaultError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request