pub enum PersistError {
Io(Error),
Serialize(Error),
Deserialize(String),
VersionMismatch {
expected: u32,
found: u32,
},
BadPath(String),
Permission(String),
}client only.Expand description
Errors produced by the persistence layer.
Every IO failure from a Persister implementation is mapped to a variant
here rather than panicked on; loaders tolerate corrupt/missing files (see
FilePersister) by
degrading to an empty snapshot.
Variants§
Io(Error)
An underlying IO error (read or write) failed.
Serialize(Error)
Serializing the snapshot (or an entry) to the persister’s format failed.
Deserialize(String)
The on-disk snapshot could not be parsed / deserialized.
Reserved for persister implementations that surface (rather than
tolerate) deserialization failures; the shipped FilePersister degrades
corrupt stores to an empty snapshot instead, so core never constructs
this variant. It is retained on the public API for backends that prefer
to propagate parse errors.
VersionMismatch
The on-disk snapshot’s version does not match PERSIST_VERSION.
Treated as a typed error (rather than silent empty-snapshot) so callers can distinguish “file was corrupt” from “file was written by a newer/older format we cannot read”.
Fields
expected: u32The version this loader understands (PERSIST_VERSION).
BadPath(String)
The requested path was unusable (e.g. the OS returned no cache dir).
Permission(String)
The persister could not acquire a required resource (e.g. file lock).
Trait Implementations§
Source§impl Debug for PersistError
impl Debug for PersistError
Source§impl Display for PersistError
impl Display for PersistError
Source§impl Error for PersistError
impl Error for PersistError
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<Error> for PersistError
impl From<Error> for PersistError
Auto Trait Implementations§
impl !RefUnwindSafe for PersistError
impl !UnwindSafe for PersistError
impl Freeze for PersistError
impl Send for PersistError
impl Sync for PersistError
impl Unpin for PersistError
impl UnsafeUnpin for PersistError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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