pub enum MigrationError {
StepFailed {
name: &'static str,
from: GenomeSchemaVersion,
to: GenomeSchemaVersion,
reason: String,
},
MissingMigrator {
from: GenomeSchemaVersion,
target: GenomeSchemaVersion,
},
InvalidRegistry(String),
DowngradeRefused {
from: GenomeSchemaVersion,
target: GenomeSchemaVersion,
},
DetectionFailed(String),
}Expand description
Errors emitted by migrators and by the chain machinery itself.
Variants§
StepFailed
A migrator returned an error during its migrate call.
MissingMigrator
The runner needed a migrator for a version but the registry didn’t have one. Indicates a gap in the chain.
InvalidRegistry(String)
A migrator’s declared to_version is not exactly from_version + 1,
or two migrators share a from_version. The runner refuses to start
in either case; see the README’s “registry MUST be contiguous” rule.
DowngradeRefused
The genome’s detected schema version is newer than the requested target. Forward-only migrations are by design.
DetectionFailed(String)
detect_schema_version could not resolve the input genome.
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
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for MigrationError
impl RefUnwindSafe for MigrationError
impl Send for MigrationError
impl Sync for MigrationError
impl Unpin for MigrationError
impl UnsafeUnpin for MigrationError
impl UnwindSafe for MigrationError
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