pub struct WriteAllFailure { /* private fields */ }Expand description
A whole-file write failure retaining the recoverable writer when available.
This value is returned by FileSystem::write_all and is not constructed
directly by callers.
§Examples
use qubit_fs::write::WriteAllFailure;
fn inspect_failure(failure: WriteAllFailure) {
let (error, state, confirmed_bytes, recovery) = failure.into_parts();
eprintln!("write failed after {confirmed_bytes} confirmed bytes: {error}");
if recovery.is_some() {
eprintln!("a writer is available for explicit recovery");
}
eprintln!("publication state: {state:?}");
}Implementations§
Source§impl WriteAllFailure
impl WriteAllFailure
Sourcepub const fn error(&self) -> &FsError
pub const fn error(&self) -> &FsError
Returns the causal filesystem error.
§Returns
The filesystem error with its original operation and provider context.
Sourcepub const fn state(&self) -> WriteFailureState
pub const fn state(&self) -> WriteFailureState
Returns publication certainty at the original failure, even after recovery.
§Returns
The immutable publication state captured when the write failed.
Sourcepub const fn written_bytes(&self) -> u64
pub const fn written_bytes(&self) -> u64
Returns the original acknowledged byte count, excluding uncertain writes.
§Returns
The number of bytes acknowledged before the failure.
Sourcepub fn take_recovery(&mut self) -> Option<WriterRecovery>
pub fn take_recovery(&mut self) -> Option<WriterRecovery>
Transfers the retained session without changing the failure snapshot.
§Returns
The retained writer, or None if no writer remains available.
Sourcepub fn recovery(&self) -> Option<&WriterRecovery>
pub fn recovery(&self) -> Option<&WriterRecovery>
Returns the retained writer, if opening had completed.
§Returns
A shared reference to the retained writer, or None if unavailable.
Sourcepub fn recovery_mut(&mut self) -> Option<&mut WriterRecovery>
pub fn recovery_mut(&mut self) -> Option<&mut WriterRecovery>
Returns a mutable retained writer for explicit recovery.
§Returns
A mutable reference to the retained writer, or None if unavailable.
Sourcepub fn into_parts(
self,
) -> (FsError, WriteFailureState, u64, Option<WriterRecovery>)
pub fn into_parts( self, ) -> (FsError, WriteFailureState, u64, Option<WriterRecovery>)
Returns the causal error and optional writer.
§Returns
The original error, publication state, confirmed byte count, and optional retained writer.