pub enum Error {
KeyNotFound {
key_id: String,
operation: String,
},
KeyExpired {
key_id: String,
expired_at: SystemTime,
},
InvalidKeyState {
key_id: String,
state: String,
operation: String,
},
CryptoError {
operation: String,
message: String,
key_id: Option<String>,
},
StorageError {
operation: String,
message: String,
path: Option<String>,
},
InsufficientEntropy {
operation: String,
},
RotationFailed {
key_id: String,
reason: String,
},
SerializationError {
operation: String,
message: String,
},
IoError {
operation: String,
source: Error,
},
AuthenticationFailed {
reason: String,
attempts: Option<u32>,
},
ConfigurationError {
message: String,
},
}Expand description
rust-keyvault error type with enhanced context
Variants§
KeyNotFound
Key not found in storage
Fields
KeyExpired
Key has expired
InvalidKeyState
Key is in the wrong state for requested operation
Fields
CryptoError
Cryptographic operation failed
Fields
StorageError
Storage backend failed
Fields
InsufficientEntropy
Insufficient entropy available
RotationFailed
Key rotation failed
Fields
SerializationError
Serialization/deserialization error
Fields
IoError
Generic I/O error with context
AuthenticationFailed
Authentication failed
Fields
ConfigurationError
Configuration error
Implementations§
Source§impl Error
impl Error
Sourcepub fn crypto<S: Into<String>>(operation: S, message: S) -> Self
pub fn crypto<S: Into<String>>(operation: S, message: S) -> Self
Create a crypto error with context
Sourcepub fn crypto_with_key<S: Into<String>>(
operation: S,
message: S,
key_id: S,
) -> Self
pub fn crypto_with_key<S: Into<String>>( operation: S, message: S, key_id: S, ) -> Self
Create a crypto error with key context
Sourcepub fn storage<S: Into<String>>(operation: S, message: S) -> Self
pub fn storage<S: Into<String>>(operation: S, message: S) -> Self
Create a storage error with context
Sourcepub fn storage_with_path<S: Into<String>>(
operation: S,
message: S,
path: S,
) -> Self
pub fn storage_with_path<S: Into<String>>( operation: S, message: S, path: S, ) -> Self
Create a storage error with path context
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn is_auth_failure(&self) -> bool
pub fn is_auth_failure(&self) -> bool
Check if error is a authentication failure
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()
Auto Trait Implementations§
impl Freeze for Error
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