pub trait WriteFailure:
From<DbError>
+ From<Error>
+ CarriesBug {
// Required methods
fn with_rollback(self, rollback: Error) -> Self;
fn with_cleanup(write: Self, failures: Vec<DbError>) -> Self
where Self: Sized;
}Expand description
A caller’s write error can retain both its original cause and failures that
happen while rolling back or removing bytes, and says which bug it carries,
for a write whose caller stopped waiting (E15). A write fails with its
closure’s own error type, which implements this: DbError for ordinary
database clients, sync’s error for sync’s writes, and an app’s own type
for the app’s writes through the facade (E3).
Required Methods§
Sourcefn with_rollback(self, rollback: Error) -> Self
fn with_rollback(self, rollback: Error) -> Self
Retain a failed rollback alongside the original failure.
Sourcefn with_cleanup(write: Self, failures: Vec<DbError>) -> Selfwhere
Self: Sized,
fn with_cleanup(write: Self, failures: Vec<DbError>) -> Selfwhere
Self: Sized,
Retain the failed write’s error and every failed byte-removal operation.
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.
Implementors§
impl WriteFailure for CovenError
An app’s write failing with CovenError keeps a failed rollback or byte
removal in the error it wraps: the database’s and a sync step’s in their
own, any other beside it (Appendix C.3).
impl WriteFailure for DbError
impl WriteFailure for SyncError
Sync’s own writes keep their error: a database failure as itself, and any other with a failed rollback or byte removal as a later step that failed too (§4, Appendix C.3).