Enum StoreError
pub enum StoreError {
WriterBusy {
path: PathBuf,
},
EmptyExistingDocument {
path: PathBuf,
},
SourceChanged {
path: PathBuf,
},
InvalidSchema {
path: PathBuf,
reason: &'static str,
},
PackageId(String, &'static str),
RecordKey(String, &'static str),
Io {
context: String,
source: Error,
},
Automerge {
path: PathBuf,
source: Box<AutomergeError>,
},
NewerSchema {
path: PathBuf,
found: u32,
understood: u32,
},
Migration {
path: PathBuf,
from: u32,
to: u32,
message: String,
},
}Expand description
Everything that can go wrong opening, reading or writing a store.
Variants§
WriterBusy
EmptyExistingDocument
SourceChanged
InvalidSchema
PackageId(String, &'static str)
RecordKey(String, &'static str)
The record key could not be turned into a directory name (distinct from
StoreError::PackageId so the message names which input was wrong).
Io
Automerge
The stored bytes are not a loadable Automerge document. Boxed: unlike
this crate’s other variants, AutomergeError alone is well over 100
bytes (nested enums carrying PatchAction, Strings, etc.), which
would make every Result<_, StoreError> in this crate’s public API
large regardless of which variant is actually returned.
NewerSchema
The document was written by a newer build than this one. Kept separate
from StoreError::Automerge because the data is intact and only this
build is wrong for it — saying “unreadable” would lose that distinction.
Migration
An app-owned migration declined an older, otherwise readable layout.
Trait Implementations§
§impl Debug for StoreError
impl Debug for StoreError
§impl Display for StoreError
impl Display for StoreError
§impl Error for StoreError
impl Error for StoreError
§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()
§impl From<StoreError> for RecordOpenError
impl From<StoreError> for RecordOpenError
§fn from(source: StoreError) -> RecordOpenError
fn from(source: StoreError) -> RecordOpenError
§impl From<StoreError> for StoreError
impl From<StoreError> for StoreError
§fn from(error: StoreError) -> StoreError
fn from(error: StoreError) -> StoreError
§impl From<StoreError> for TransferError
impl From<StoreError> for TransferError
§fn from(source: StoreError) -> TransferError
fn from(source: StoreError) -> TransferError
Auto Trait Implementations§
impl Freeze for StoreError
impl !RefUnwindSafe for StoreError
impl Send for StoreError
impl Sync for StoreError
impl Unpin for StoreError
impl UnsafeUnpin for StoreError
impl !UnwindSafe for StoreError
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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