pub enum StorageError {
NotFound(String),
Io(Error),
Serialization(Error),
InvalidPath(PathBuf),
DirectoryCreation {
path: PathBuf,
source: Error,
},
ChecksumMismatch {
session_id: String,
expected: String,
actual: String,
},
VersionIncompatible {
file_version: u32,
supported_version: u32,
},
PermissionDenied(String),
Snapshot(SnapshotError),
}Expand description
Errors that can occur during session storage operations.
Variants§
NotFound(String)
Session not found.
Io(Error)
I/O error during file operations.
Serialization(Error)
JSON serialization/deserialization error.
InvalidPath(PathBuf)
Invalid path.
DirectoryCreation
Storage directory creation failed.
ChecksumMismatch
Checksum mismatch (data corruption).
VersionIncompatible
Version incompatibility.
PermissionDenied(String)
Permission denied.
Snapshot(SnapshotError)
Snapshot restore failed for an Enabled component.
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn invalid_path(path: impl Into<PathBuf>) -> Self
pub fn invalid_path(path: impl Into<PathBuf>) -> Self
Creates an InvalidPath error.
Sourcepub fn directory_creation(path: impl Into<PathBuf>, source: Error) -> Self
pub fn directory_creation(path: impl Into<PathBuf>, source: Error) -> Self
Creates a DirectoryCreation error.
Sourcepub fn checksum_mismatch(
session_id: impl Into<String>,
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self
pub fn checksum_mismatch( session_id: impl Into<String>, expected: impl Into<String>, actual: impl Into<String>, ) -> Self
Creates a ChecksumMismatch error.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Returns true if this is a recoverable 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()
Source§impl From<Error> for StorageError
impl From<Error> for StorageError
Source§impl From<Error> for StorageError
impl From<Error> for StorageError
Source§impl From<SnapshotError> for StorageError
impl From<SnapshotError> for StorageError
Source§fn from(source: SnapshotError) -> Self
fn from(source: SnapshotError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze 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