#[non_exhaustive]pub enum StoreError {
KeyNotFound {
store: String,
key: String,
},
SerializationFailed {
store: String,
reason: String,
},
DeserializationFailed {
store: String,
reason: String,
},
TypeMismatch {
store: String,
expected: String,
actual: String,
},
InvalidOperation {
store: String,
operation: String,
reason: String,
},
RequiresTransaction {
store: String,
},
DataCorruption {
store: String,
reason: String,
},
InvalidConfiguration {
store: String,
reason: String,
},
ImplementationError {
store: String,
reason: String,
},
}Expand description
Generic error types for store operations.
This enum provides fundamental error variants that apply to any store implementation. Specific store types (DocStore, Table, etc.) should define their own error types for implementation-specific errors and convert them to SubtreeError when needed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
KeyNotFound
Key or record not found in store
SerializationFailed
Serialization failed for store data
DeserializationFailed
Deserialization failed for store data
TypeMismatch
Type mismatch in store operation
InvalidOperation
Invalid operation for the store type
RequiresTransaction
Store operation requires transaction context
DataCorruption
Data corruption detected in store
InvalidConfiguration
Invalid configuration for the store
ImplementationError
Implementation-specific error from a store type
Implementations§
Source§impl StoreError
impl StoreError
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this error indicates a resource was not found
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_integrity_error(&self) -> bool
pub fn is_integrity_error(&self) -> bool
Check if this error is related to data integrity
Sourcepub fn is_operation_error(&self) -> bool
pub fn is_operation_error(&self) -> bool
Check if this error is related to invalid operations
Sourcepub fn is_implementation_error(&self) -> bool
pub fn is_implementation_error(&self) -> bool
Check if this error is implementation-specific
Sourcepub fn store_name(&self) -> &str
pub fn store_name(&self) -> &str
Get the store name associated with this error
Trait Implementations§
Source§impl Debug for StoreError
impl Debug for StoreError
Source§impl Display for StoreError
impl Display for StoreError
Source§impl Error for StoreError
impl Error for StoreError
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
Source§impl From<StoreError> for Error
impl From<StoreError> for Error
Source§fn from(err: StoreError) -> Self
fn from(err: StoreError) -> Self
Auto Trait Implementations§
impl Freeze for StoreError
impl RefUnwindSafe for StoreError
impl Send for StoreError
impl Sync for StoreError
impl Unpin 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> 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.