#[non_exhaustive]pub enum CRDTError {
MergeFailed {
reason: String,
},
SerializationFailed {
reason: String,
},
DeserializationFailed {
reason: String,
},
TypeMismatch {
expected: String,
actual: String,
},
InvalidValue {
reason: String,
},
ListOperationFailed {
operation: String,
reason: String,
},
DocOperationFailed {
operation: String,
reason: String,
},
NestedOperationFailed {
path: String,
reason: String,
},
InvalidUuid {
uuid: String,
},
ElementNotFound {
key: String,
},
InvalidPath {
path: String,
},
ListIndexOutOfBounds {
index: usize,
len: usize,
},
}Expand description
Structured error types for CRDT operations.
This enum provides specific error variants for different types of failures that can occur during CRDT operations, including merge conflicts, serialization issues, and type validation errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MergeFailed
A merge operation failed between two CRDT instances
SerializationFailed
Serialization of CRDT data failed
DeserializationFailed
Deserialization of CRDT data failed
TypeMismatch
Type mismatch during CRDT operation
InvalidValue
Invalid value provided for CRDT operation
ListOperationFailed
List operation failed
DocOperationFailed
Document operation failed
NestedOperationFailed
Nested structure operation failed
InvalidUuid
Invalid UUID format in list operations
ElementNotFound
Element not found in CRDT structure
InvalidPath
Invalid path for nested operations
ListIndexOutOfBounds
List index out of bounds
Implementations§
Source§impl CRDTError
impl CRDTError
Sourcepub fn is_merge_error(&self) -> bool
pub fn is_merge_error(&self) -> bool
Check if this error is related to merge operations
Sourcepub fn is_serialization_error(&self) -> bool
pub fn is_serialization_error(&self) -> bool
Check if this error is related to serialization
Sourcepub fn is_type_error(&self) -> bool
pub fn is_type_error(&self) -> bool
Check if this error is related to type mismatches
Sourcepub fn is_list_operation_error(&self) -> bool
pub fn is_list_operation_error(&self) -> bool
Check if this error is related to list operations (operation-level)
Sourcepub fn is_doc_error(&self) -> bool
pub fn is_doc_error(&self) -> bool
Check if this error is related to doc operations
Sourcepub fn is_nested_error(&self) -> bool
pub fn is_nested_error(&self) -> bool
Check if this error is related to nested operations
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this error is related to element lookup
Sourcepub fn is_list_error(&self) -> bool
pub fn is_list_error(&self) -> bool
Check if this error is related to list operations
Trait Implementations§
Source§impl Error for CRDTError
impl Error for CRDTError
1.30.0 · 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
Auto Trait Implementations§
impl Freeze for CRDTError
impl RefUnwindSafe for CRDTError
impl Send for CRDTError
impl Sync for CRDTError
impl Unpin for CRDTError
impl UnwindSafe for CRDTError
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> CompatExt for T
impl<T> CompatExt 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.