#[non_exhaustive]pub enum DatabaseError {
FileCreationError {
context: String,
source: Box<dyn Error + Send + Sync + 'static>,
},
SqlError(Error),
}Expand description
Error types for database operations.
Marked #[non_exhaustive] so adding new DB failure modes (e.g. migration,
pool, lock-contention) is not a breaking change.
FileCreationError carries a #[source] so the underlying io::Error /
JoinError / sqlx::Error is reachable through std::error::Error::source()
rather than flattened into a single String (the previous tuple-variant
design lost all of that diagnostic structure when the chain was walked).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FileCreationError
Error creating, opening, or initializing the database file.
context describes the high-level operation ("creating directory",
"opening database file", etc.); source is the underlying error so
callers can downcast_ref::<io::Error>() if they need to branch on the
kind (e.g. PermissionDenied).
Fields
SqlError(Error)
SQL execution error.
Trait Implementations§
Source§impl Debug for DatabaseError
impl Debug for DatabaseError
Source§impl Display for DatabaseError
impl Display for DatabaseError
Source§impl Error for DatabaseError
impl Error for DatabaseError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for DatabaseError
impl !UnwindSafe for DatabaseError
impl Forget for DatabaseError
impl Freeze for DatabaseError
impl Move for DatabaseError
impl Send for DatabaseError
impl Sync for DatabaseError
impl Unpin for DatabaseError
impl UnsafeUnpin for DatabaseError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<E> ErrorExt for E
impl<E> ErrorExt for E
Source§fn display_chain(&self) -> String
fn display_chain(&self) -> String
Source§fn display_chain_with_msg(&self, msg: &str) -> String
fn display_chain_with_msg(&self, msg: &str) -> String
display_chain but with an extra message at the start.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