pub enum CargoCryptError {
Io {
message: String,
source: Error,
},
Crypto {
message: String,
kind: CryptoErrorKind,
},
Config {
message: String,
suggestion: Option<String>,
},
Project {
message: String,
suggestion: Option<String>,
},
Auth {
message: String,
retry_suggestion: Option<String>,
},
KeyManagement {
message: String,
recovery_suggestion: Option<String>,
},
Serialization {
message: String,
source: Box<dyn Error + Send + Sync>,
},
Network {
message: String,
source: Box<dyn Error + Send + Sync>,
},
Git {
message: String,
source: Option<Error>,
},
Validation {
message: String,
errors: Vec<String>,
warnings: Vec<String>,
},
}Expand description
Main error type for CargoCrypt operations
Variants§
Io
I/O errors (file operations, network, etc.)
Crypto
Cryptographic operation errors
Config
Configuration errors
Project
Project structure errors
Auth
Authentication/Authorization errors
KeyManagement
Key management errors
Serialization
Serialization/Deserialization errors
Network
Network-related errors
Git
Git operations errors
Validation
Validation errors
Implementations§
Source§impl CargoCryptError
Commonly used error constructors for better ergonomics
impl CargoCryptError
Commonly used error constructors for better ergonomics
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get the severity level of this error
Sourcepub fn project_not_found() -> Self
pub fn project_not_found() -> Self
Create a project not found error with helpful suggestion
Sourcepub fn config_not_found() -> Self
pub fn config_not_found() -> Self
Create a configuration file not found error
Sourcepub fn invalid_password() -> Self
pub fn invalid_password() -> Self
Create an invalid password error
Sourcepub fn file_not_found(path: &Path) -> Self
pub fn file_not_found(path: &Path) -> Self
Create a file not found error with context
Sourcepub fn decryption_failed(details: &str) -> Self
pub fn decryption_failed(details: &str) -> Self
Create a decryption failure error
Sourcepub fn encryption_failed(details: &str) -> Self
pub fn encryption_failed(details: &str) -> Self
Create an encryption failure error
Sourcepub fn key_derivation_failed(details: &str) -> Self
pub fn key_derivation_failed(details: &str) -> Self
Create a key derivation failure error
Sourcepub fn invalid_key(details: &str) -> Self
pub fn invalid_key(details: &str) -> Self
Create an invalid key error
Sourcepub fn authentication_failed() -> Self
pub fn authentication_failed() -> Self
Create an authentication failure error
Sourcepub fn random_generation_failed() -> Self
pub fn random_generation_failed() -> Self
Create a random generation failure error
Sourcepub fn detection_error(message: &str) -> Self
pub fn detection_error(message: &str) -> Self
Create a detection error
Sourcepub fn crypto_kind(&self) -> Option<&CryptoErrorKind>
pub fn crypto_kind(&self) -> Option<&CryptoErrorKind>
Get the error kind if this is a crypto error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable (user can retry)
Sourcepub fn suggestion(&self) -> Option<&str>
pub fn suggestion(&self) -> Option<&str>
Get a user-friendly suggestion for resolving this error
Trait Implementations§
Source§impl Debug for CargoCryptError
impl Debug for CargoCryptError
Source§impl Display for CargoCryptError
impl Display for CargoCryptError
Source§impl Error for CargoCryptError
impl Error for CargoCryptError
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
Source§impl From<CryptoError> for CargoCryptError
Convert from CryptoError
impl From<CryptoError> for CargoCryptError
Convert from CryptoError
Source§fn from(error: CryptoError) -> Self
fn from(error: CryptoError) -> Self
Source§impl From<Error> for CargoCryptError
Convert from standard I/O errors
impl From<Error> for CargoCryptError
Convert from standard I/O errors
Source§impl From<Error> for CargoCryptError
Convert from serde JSON errors
impl From<Error> for CargoCryptError
Convert from serde JSON errors
Source§impl From<Error> for CargoCryptError
Convert from TOML errors
impl From<Error> for CargoCryptError
Convert from TOML errors
Source§impl From<Error> for CargoCryptError
Convert from reqwest errors
impl From<Error> for CargoCryptError
Convert from reqwest errors
Source§impl From<Error> for CargoCryptError
Convert from git2 errors
impl From<Error> for CargoCryptError
Convert from git2 errors
Auto Trait Implementations§
impl Freeze for CargoCryptError
impl !RefUnwindSafe for CargoCryptError
impl Send for CargoCryptError
impl Sync for CargoCryptError
impl Unpin for CargoCryptError
impl !UnwindSafe for CargoCryptError
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 more