pub enum MemoryError {
Sqlite {
context: String,
source: Error,
},
Io {
context: String,
source: Error,
},
Serde {
context: String,
source: Error,
},
Logic(String),
}Expand description
Errors produced by the memory store.
Variants§
Sqlite
A SQLite operation failed. context describes what we were trying to
do; source is the underlying sqlx::Error for chain inspection.
Fields
Io
A filesystem operation failed. context describes what we were trying
to do; source is the underlying std::io::Error.
Fields
Serde
JSON serialization or deserialization failed.
Fields
Logic(String)
Domain-logic error with no foreign source — invalid arguments, missing rows, malformed input, etc.
Implementations§
Source§impl MemoryError
impl MemoryError
Sourcepub fn sqlite(context: impl Into<String>, source: Error) -> Self
pub fn sqlite(context: impl Into<String>, source: Error) -> Self
Wrap a sqlx::Error with operation context.
Sourcepub fn io(context: impl Into<String>, source: Error) -> Self
pub fn io(context: impl Into<String>, source: Error) -> Self
Wrap a std::io::Error with operation context.
Trait Implementations§
Source§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
Source§impl Error for MemoryError
impl Error for MemoryError
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<MemoryError> for KernexError
Bridge to the workspace-level aggregate error.
impl From<MemoryError> for KernexError
Bridge to the workspace-level aggregate error.
Boxes the typed MemoryError inside KernexError::Store so callers
downstream can recover the structured cause via
boxed.downcast_ref::<MemoryError>() and pattern-match on the
concrete variant (e.g. MemoryError::Sqlite { source, .. } to inspect
the underlying sqlx::Error).
Source§fn from(err: MemoryError) -> Self
fn from(err: MemoryError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryError
impl !UnwindSafe for MemoryError
impl Freeze for MemoryError
impl Send for MemoryError
impl Sync for MemoryError
impl Unpin for MemoryError
impl UnsafeUnpin for MemoryError
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
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