pub enum StorageError {
DirectoryCreationFailed {
path: PathBuf,
source: Error,
},
IoError {
path: PathBuf,
operation: IoOperation,
source: Error,
},
ParseError {
path: PathBuf,
format: String,
message: String,
},
ValidationError {
field: String,
message: String,
},
PathResolutionError {
message: String,
},
EnvVarError {
var_name: String,
message: String,
},
RelocationError {
from: PathBuf,
to: PathBuf,
message: String,
},
StorageUnavailable {
path: PathBuf,
message: String,
},
FirstRunConfirmationRequired {
suggested_path: PathBuf,
},
Io(Error),
Internal(String),
}Expand description
Storage error types
Variants§
DirectoryCreationFailed
Directory creation failed
IoError
File read/write failed
ParseError
Configuration parsing failed
ValidationError
Invalid configuration value
PathResolutionError
Path resolution failed
EnvVarError
Environment variable error
RelocationError
Relocation failed
Offline mode - storage unavailable
FirstRunConfirmationRequired
First-run confirmation required
Io(Error)
Generic IO error
Internal(String)
Internal error
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn directory_creation_failed(path: PathBuf, source: Error) -> Self
pub fn directory_creation_failed(path: PathBuf, source: Error) -> Self
Create a directory creation failed error
Sourcepub fn io_error(path: PathBuf, operation: IoOperation, source: Error) -> Self
pub fn io_error(path: PathBuf, operation: IoOperation, source: Error) -> Self
Create an IO error
Sourcepub fn parse_error(
path: PathBuf,
format: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn parse_error( path: PathBuf, format: impl Into<String>, message: impl Into<String>, ) -> Self
Create a parse error
Sourcepub fn validation_error(
field: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn validation_error( field: impl Into<String>, message: impl Into<String>, ) -> Self
Create a validation error
Sourcepub fn path_resolution_error(message: impl Into<String>) -> Self
pub fn path_resolution_error(message: impl Into<String>) -> Self
Create a path resolution error
Sourcepub fn env_var_error(
var_name: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn env_var_error( var_name: impl Into<String>, message: impl Into<String>, ) -> Self
Create an environment variable error
Sourcepub fn relocation_error(
from: PathBuf,
to: PathBuf,
message: impl Into<String>,
) -> Self
pub fn relocation_error( from: PathBuf, to: PathBuf, message: impl Into<String>, ) -> Self
Create a relocation error
Create a storage unavailable error
Sourcepub fn first_run_confirmation_required(suggested_path: PathBuf) -> Self
pub fn first_run_confirmation_required(suggested_path: PathBuf) -> Self
Create a first-run confirmation required error
Trait Implementations§
Source§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
Source§impl Error for StorageError
impl Error for StorageError
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 StorageError
impl !RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl !UnwindSafe for StorageError
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