pub struct OpenFailure<R> { /* private fields */ }Expand description
A failed open with its causal error and optional isolated recovery session.
R owns only explicit cleanup authority. Keep this error or take its
recovery session before reporting failure. Dropping the error does not
confirm cleanup. There is deliberately no conversion into FsError that
discards recovery.
§Examples
use qubit_fs::error::{FsError, FsErrorKind, FsOperation, OpenFailure, OpenFailureStage};
assert!(std::any::type_name::<OpenFailure<()>>().contains("OpenFailure"));
let error = FsError::new(FsErrorKind::NotFound, FsOperation::OpenReader, "missing");
assert_eq!(FsOperation::OpenReader, error.operation());
assert_eq!(OpenFailureStage::Preflight, OpenFailureStage::Preflight);Implementations§
Source§impl<R> OpenFailure<R>
impl<R> OpenFailure<R>
Sourcepub const fn error(&self) -> &FsError
pub const fn error(&self) -> &FsError
Returns the original failure; cleanup does not rewrite it.
Sourcepub const fn stage(&self) -> OpenFailureStage
pub const fn stage(&self) -> OpenFailureStage
Returns the stage where opening stopped.
Sourcepub const fn recovery(&self) -> Option<&R>
pub const fn recovery(&self) -> Option<&R>
Returns the retained recovery session, or None before an envelope arrived.
Sourcepub fn recovery_mut(&mut self) -> Option<&mut R>
pub fn recovery_mut(&mut self) -> Option<&mut R>
Borrows the retained session for explicit cleanup, when available.
Sourcepub fn take_recovery(&mut self) -> Option<R>
pub fn take_recovery(&mut self) -> Option<R>
Transfers recovery ownership without changing the historical failure.
Sourcepub fn into_parts(self) -> (FsError, OpenFailureStage, Option<R>)
pub fn into_parts(self) -> (FsError, OpenFailureStage, Option<R>)
Returns all failure facts and transfers any recovery ownership.
§Returns
The original error, opening stage, and optional retained recovery session.
Trait Implementations§
Source§impl<R> Debug for OpenFailure<R>
impl<R> Debug for OpenFailure<R>
Source§impl<R> Display for OpenFailure<R>
impl<R> Display for OpenFailure<R>
Source§impl<R: 'static> Error for OpenFailure<R>
impl<R: 'static> Error for OpenFailure<R>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Exposes the original error chain without surrendering recovery ownership.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()