pub trait DatabaseError<T, E> {
// Required methods
fn tern_result(self) -> TernResult<T>;
fn void_tern_result(self) -> TernResult<()>;
fn tern_migration_result<M: Migration + ?Sized>(
self,
migration: &M,
) -> TernResult<T>;
fn void_tern_migration_result<M: Migration + ?Sized>(
self,
migration: &M,
) -> TernResult<()>;
fn with_report(self, report: &[MigrationResult]) -> TernResult<T>;
}Expand description
Converting a result with a generic std::error::Error to one with this
crate’s error type.
The *_migration_result methods allow attaching a migration to the error,
such as the one being handled when the error occurred. The with_report
method allows attaching a slice of MigrationResult to the error to show
what collection of the migration set did succeed in being applied before the
error was encountered.
Required Methods§
Sourcefn tern_result(self) -> TernResult<T>
fn tern_result(self) -> TernResult<T>
Convert E to an Error.
Sourcefn void_tern_result(self) -> TernResult<()>
fn void_tern_result(self) -> TernResult<()>
Same as tern_result but discard the returned value.
Sourcefn tern_migration_result<M: Migration + ?Sized>(
self,
migration: &M,
) -> TernResult<T>
fn tern_migration_result<M: Migration + ?Sized>( self, migration: &M, ) -> TernResult<T>
Convert E to an Error that has a given migration in the error
type’s source.
Sourcefn void_tern_migration_result<M: Migration + ?Sized>(
self,
migration: &M,
) -> TernResult<()>
fn void_tern_migration_result<M: Migration + ?Sized>( self, migration: &M, ) -> TernResult<()>
Same as tern_migration_result but discard the returned value.
Sourcefn with_report(self, report: &[MigrationResult]) -> TernResult<T>
fn with_report(self, report: &[MigrationResult]) -> TernResult<T>
Attach an array of MigrationResult, representing a partially successful
migration operation, to the error.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.