#[non_exhaustive]pub enum LocalError {
Show 14 variants
Refused,
Exhausted,
PeerWriterAhead,
StoreExists,
RecoveryRequired,
UnsupportedFormat {
file: &'static str,
version: u8,
},
Configuration,
CounterWidth(CoordinateError),
InvalidRecord(WireError),
History(WireError),
InvalidHistory,
Io(Error),
AncestorSync {
path: PathBuf,
source: Error,
},
RecordLimitExceeded {
max_records: usize,
default_limit: bool,
},
}Expand description
Errors from local writer and durable store operations.
Downstream callers must allow for future variants:
use safemesh_crdt::local::LocalError;
fn classify(error: LocalError) -> &'static str {
match error {
LocalError::Refused => "refused",
LocalError::Exhausted => "exhausted",
LocalError::PeerWriterAhead => "writer ahead",
LocalError::StoreExists => "store exists",
LocalError::RecoveryRequired => "recovery",
LocalError::UnsupportedFormat { .. } => "unsupported format",
LocalError::Configuration => "configuration",
LocalError::CounterWidth(_) => "counter width",
LocalError::InvalidRecord(_) => "record",
LocalError::History(_) => "history",
LocalError::InvalidHistory => "invalid history",
LocalError::Io(_) => "io",
LocalError::AncestorSync { .. } => "ancestor sync",
LocalError::RecordLimitExceeded { .. } => "record limit",
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Refused
Exhausted
PeerWriterAhead
A peer supplied an own-writer record above the committed high-water.
StoreExists
A fresh writer store already exists at this root for this writer.
RecoveryRequired
Store metadata is damaged or disagrees with its durable history.
UnsupportedFormat
A stored wrapper has a version newer than this reader understands.
Configuration
CounterWidth(CoordinateError)
The requested counter width exceeds the core constructor domain.
InvalidRecord(WireError)
History(WireError)
InvalidHistory
Io(Error)
AncestorSync
First creation could not open or sync an ancestor; no fence is written.
RecordLimitExceeded
A _with_limits restart found a committed history that declares more
records than DecodeLimits::max_records. Checked
from the frame header before any record is read; the store is unchanged.
Trait Implementations§
Source§impl Debug for LocalError
impl Debug for LocalError
Source§impl Display for LocalError
impl Display for LocalError
Source§impl Error for LocalError
impl Error for LocalError
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()
1.0.0 · Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
Source§fn provide<'a>(&'a self, request: &mut Request<'a>)
fn provide<'a>(&'a self, request: &mut Request<'a>)
error_generic_member_access)Source§impl From<Error> for LocalError
impl From<Error> for LocalError
Auto Trait Implementations§
impl Freeze for LocalError
impl !RefUnwindSafe for LocalError
impl Send for LocalError
impl Sync for LocalError
impl Unpin for LocalError
impl UnsafeUnpin for LocalError
impl !UnwindSafe for LocalError
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
Source§fn type_id(&self) -> TypeId
fn type_id(&self) -> TypeId
TypeId of self. Read moreSource§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
Source§fn borrow(&self) -> &T
fn borrow(&self) -> &T
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
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Source§impl<T> ToString for Twhere
T: Display + ?Sized,
impl<T> ToString for Twhere
T: Display + ?Sized,
Source§fn to_string(&self) -> String
fn to_string(&self) -> String
String. Read more