pub struct LoraError { /* private fields */ }Expand description
Public error type at the lora-database boundary.
Construct via Self::from_anyhow (the typical path — the engine
uses anyhow::Error internally) or via the From impls for any
known concrete error type.
Implementations§
Source§impl LoraError
impl LoraError
pub fn new(code: LoraErrorCode, message: impl Into<String>) -> Self
pub fn with_source( code: LoraErrorCode, message: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
pub fn code(&self) -> LoraErrorCode
pub fn message(&self) -> &str
pub fn category(&self) -> LoraErrorCategory
Sourcepub fn from_anyhow(err: Error) -> Self
pub fn from_anyhow(err: Error) -> Self
Convert an anyhow::Error from the engine’s internal ?-chains
into a typed LoraError. Best-effort: downcasts the chain to any
known concrete error type and picks the matching code; falls back
to LoraErrorCode::Internal with the original message preserved.
Sourcepub fn from_anyhow_ref(err: &Error) -> Self
pub fn from_anyhow_ref(err: &Error) -> Self
Borrowed version of Self::from_anyhow. Useful in binding
layers that hold &anyhow::Error from a Result::Err capture
and don’t want to move the error.
Trait Implementations§
Source§impl Error for LoraError
impl Error for LoraError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<DatabaseNameError> for LoraError
impl From<DatabaseNameError> for LoraError
Source§fn from(e: DatabaseNameError) -> Self
fn from(e: DatabaseNameError) -> Self
Converts to this type from the input type.
Source§impl From<ExecutorError> for LoraError
impl From<ExecutorError> for LoraError
Source§fn from(e: ExecutorError) -> Self
fn from(e: ExecutorError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for LoraError
impl From<ParseError> for LoraError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<SemanticError> for LoraError
impl From<SemanticError> for LoraError
Source§fn from(e: SemanticError) -> Self
fn from(e: SemanticError) -> Self
Converts to this type from the input type.
Source§impl From<SnapshotCodecError> for LoraError
impl From<SnapshotCodecError> for LoraError
Source§fn from(e: SnapshotCodecError) -> Self
fn from(e: SnapshotCodecError) -> Self
Converts to this type from the input type.
Source§impl From<SnapshotError> for LoraError
impl From<SnapshotError> for LoraError
Source§fn from(e: SnapshotError) -> Self
fn from(e: SnapshotError) -> Self
Converts to this type from the input type.
Source§impl From<TransactionError> for LoraError
impl From<TransactionError> for LoraError
Source§fn from(e: TransactionError) -> Self
fn from(e: TransactionError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LoraError
impl !RefUnwindSafe for LoraError
impl Send for LoraError
impl Sync for LoraError
impl Unpin for LoraError
impl UnsafeUnpin for LoraError
impl !UnwindSafe for LoraError
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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