pub enum EncryptionError {
Show 17 variants
InvalidKey {
message: String,
},
InvalidNonce {
message: String,
},
AuthenticationFailed {
message: String,
},
InvalidCiphertext {
message: String,
},
KeyDerivationFailed {
message: String,
},
KeyNotFound {
key_id: String,
},
AccessDenied {
message: String,
},
KeyStoreError {
message: String,
},
RandomGenerationFailed {
message: String,
},
InvalidAlgorithm {
message: String,
},
CipherOperationFailed {
message: String,
},
Base64Error {
message: String,
},
SerializationError {
message: String,
},
TemplateError {
message: String,
},
AutoEncryptionConfigError {
message: String,
},
Workspace {
message: String,
},
Generic {
message: String,
},
}Expand description
Errors that can occur during encryption/decryption operations
Variants§
InvalidKey
Invalid key length or format
InvalidNonce
Invalid nonce/IV length or format
AuthenticationFailed
Authentication failed during decryption
InvalidCiphertext
Invalid ciphertext format
KeyDerivationFailed
Key derivation failed
KeyNotFound
Key not found in key store
AccessDenied
Insufficient permissions for key operation
KeyStoreError
Key store operation failed
RandomGenerationFailed
Random number generation failed
InvalidAlgorithm
Invalid algorithm configuration
CipherOperationFailed
Cipher operation failed
Base64Error
Base64 encoding/decoding failed
SerializationError
Serialization/deserialization failed
TemplateError
Template processing failed
AutoEncryptionConfigError
Auto-encryption configuration error
Workspace
Workspace encryption error
Generic
Generic encryption error
Implementations§
Source§impl EncryptionError
impl EncryptionError
Sourcepub fn invalid_key(message: impl Into<String>) -> EncryptionError
pub fn invalid_key(message: impl Into<String>) -> EncryptionError
Create a new invalid key error
Sourcepub fn invalid_nonce(message: impl Into<String>) -> EncryptionError
pub fn invalid_nonce(message: impl Into<String>) -> EncryptionError
Create a new invalid nonce error
Sourcepub fn authentication_failed(message: impl Into<String>) -> EncryptionError
pub fn authentication_failed(message: impl Into<String>) -> EncryptionError
Create a new authentication failed error
Sourcepub fn invalid_ciphertext(message: impl Into<String>) -> EncryptionError
pub fn invalid_ciphertext(message: impl Into<String>) -> EncryptionError
Create a new invalid ciphertext error
Sourcepub fn key_derivation_failed(message: impl Into<String>) -> EncryptionError
pub fn key_derivation_failed(message: impl Into<String>) -> EncryptionError
Create a new key derivation failed error
Sourcepub fn key_not_found(key_id: impl Into<String>) -> EncryptionError
pub fn key_not_found(key_id: impl Into<String>) -> EncryptionError
Create a new key not found error
Sourcepub fn access_denied(message: impl Into<String>) -> EncryptionError
pub fn access_denied(message: impl Into<String>) -> EncryptionError
Create a new access denied error
Sourcepub fn key_store_error(message: impl Into<String>) -> EncryptionError
pub fn key_store_error(message: impl Into<String>) -> EncryptionError
Create a new key store error
Sourcepub fn random_generation_failed(message: impl Into<String>) -> EncryptionError
pub fn random_generation_failed(message: impl Into<String>) -> EncryptionError
Create a new random generation failed error
Sourcepub fn invalid_algorithm(message: impl Into<String>) -> EncryptionError
pub fn invalid_algorithm(message: impl Into<String>) -> EncryptionError
Create a new invalid algorithm error
Sourcepub fn cipher_operation_failed(message: impl Into<String>) -> EncryptionError
pub fn cipher_operation_failed(message: impl Into<String>) -> EncryptionError
Create a new cipher operation failed error
Sourcepub fn base64_error(message: impl Into<String>) -> EncryptionError
pub fn base64_error(message: impl Into<String>) -> EncryptionError
Create a new base64 error
Sourcepub fn serialization_error(message: impl Into<String>) -> EncryptionError
pub fn serialization_error(message: impl Into<String>) -> EncryptionError
Create a new serialization error
Sourcepub fn template_error(message: impl Into<String>) -> EncryptionError
pub fn template_error(message: impl Into<String>) -> EncryptionError
Create a new template error
Sourcepub fn auto_encryption_config_error(
message: impl Into<String>,
) -> EncryptionError
pub fn auto_encryption_config_error( message: impl Into<String>, ) -> EncryptionError
Create a new auto-encryption config error
Sourcepub fn workspace_encryption_error(message: impl Into<String>) -> EncryptionError
pub fn workspace_encryption_error(message: impl Into<String>) -> EncryptionError
Create a new workspace encryption error
Sourcepub fn generic(message: impl Into<String>) -> EncryptionError
pub fn generic(message: impl Into<String>) -> EncryptionError
Create a new generic error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this is a recoverable error
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity level
Source§impl EncryptionError
impl EncryptionError
Sourcepub fn suggested_recovery(&self) -> ErrorRecoveryStrategy
pub fn suggested_recovery(&self) -> ErrorRecoveryStrategy
Suggest recovery strategy based on error type
Sourcepub fn with_context(self, context: ErrorContext) -> ContextualError
pub fn with_context(self, context: ErrorContext) -> ContextualError
Convert to contextual error
Trait Implementations§
Source§impl Debug for EncryptionError
impl Debug for EncryptionError
Source§impl Display for EncryptionError
impl Display for EncryptionError
Source§impl Error for EncryptionError
impl Error for EncryptionError
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()
Source§impl From<EncryptionError> for Error
impl From<EncryptionError> for Error
Source§fn from(source: EncryptionError) -> Error
fn from(source: EncryptionError) -> Error
Auto Trait Implementations§
impl Freeze for EncryptionError
impl RefUnwindSafe for EncryptionError
impl Send for EncryptionError
impl Sync for EncryptionError
impl Unpin for EncryptionError
impl UnsafeUnpin for EncryptionError
impl UnwindSafe for EncryptionError
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
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.