Skip to main content

WriteFailure

Trait WriteFailure 

Source
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§

Source

fn with_rollback(self, rollback: Error) -> Self

Retain a failed rollback alongside the original failure.

Source

fn with_cleanup(write: Self, failures: Vec<DbError>) -> Self
where 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§