#[non_exhaustive]pub enum MigrationError {
Migrate(MigrateError),
ExtractIo {
context: String,
source: Error,
},
BlockingTask(JoinError),
}Expand description
Error types for run_migrations.
Distinguishes the underlying failure mode (sqlx migrator error, on-disk
extraction failure, blocking-task panic) so callers can branch on the
cause rather than parsing a single opaque message. Each variant exposes
the original error via #[source] for chain walks.
Marked #[non_exhaustive] so adding new failure modes is not breaking.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Migrate(MigrateError)
SQLx migrator failed to load or execute a migration.
ExtractIo
On-disk extraction of embedded migrations failed (create_dir_all,
write to TempDir, etc).
Fields
BlockingTask(JoinError)
tokio::task::spawn_blocking for the extraction step panicked or
was cancelled.
Trait Implementations§
Source§impl Debug for MigrationError
impl Debug for MigrationError
Source§impl Display for MigrationError
impl Display for MigrationError
Source§impl Error for MigrationError
impl Error for MigrationError
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<JoinError> for MigrationError
impl From<JoinError> for MigrationError
Source§impl From<MigrateError> for MigrationError
impl From<MigrateError> for MigrationError
Source§fn from(source: MigrateError) -> Self
fn from(source: MigrateError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for MigrationError
impl !UnwindSafe for MigrationError
impl Forget for MigrationError
impl Freeze for MigrationError
impl Move for MigrationError
impl Send for MigrationError
impl Sync for MigrationError
impl Unpin for MigrationError
impl UnsafeUnpin for MigrationError
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
Mutably borrows from an owned value. Read more
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
Returns a string representation of the entire error chain.
Source§fn display_chain_with_msg(&self, msg: &str) -> String
fn display_chain_with_msg(&self, msg: &str) -> String
Like
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> ⓘ
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