#[non_exhaustive]pub enum StorageError {
FileNotFound {
code: ErrorCode,
path: String,
},
FileAlreadyExists {
code: ErrorCode,
path: String,
},
PermissionDenied {
code: ErrorCode,
path: String,
},
InvalidFormat {
code: ErrorCode,
reason: String,
},
Database {
code: ErrorCode,
message: String,
},
Io {
code: ErrorCode,
message: String,
},
HomeNotFound {
code: ErrorCode,
},
Migration {
code: ErrorCode,
message: String,
},
Serialization {
code: ErrorCode,
message: String,
},
HiddenVolumeFull {
code: ErrorCode,
},
}Expand description
Storage operation errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FileNotFound
FileAlreadyExists
PermissionDenied
InvalidFormat
Database
Io
HomeNotFound
Migration
Serialization
HiddenVolumeFull
Implementations§
Source§impl StorageError
impl StorageError
pub fn file_not_found(path: impl Into<String>) -> Self
pub fn file_already_exists(path: impl Into<String>) -> Self
pub fn permission_denied(path: impl Into<String>) -> Self
pub fn invalid_format(reason: impl Into<String>) -> Self
pub fn corrupted(message: impl Into<String>) -> Self
pub fn database(message: impl Into<String>) -> Self
pub fn io(message: impl Into<String>) -> Self
pub fn home_not_found() -> Self
pub fn migration(message: impl Into<String>) -> Self
pub fn serialization(message: impl Into<String>) -> Self
pub fn code(&self) -> ErrorCode
pub fn path(&self) -> Option<&str>
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
1.30.0 · 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()
Source§impl From<StorageError> for KeepError
impl From<StorageError> for KeepError
Source§fn from(source: StorageError) -> Self
fn from(source: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for StorageError
impl Freeze for StorageError
impl Move for StorageError
impl RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnsafeUnpin 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