pub enum AsyncWriterRecovery {
Opened(Box<AsyncFileWriter>),
Rejected(RejectedAsyncWriter),
}Expand description
A retained session that is either validated or restricted to explicit cleanup.
Matching the variant is required before performing recovery. A rejected
session cannot write or publish data. This value does not describe the
historical publication state; use the failure snapshot for that fact.
Recovery values come from an operation through recovery or
take_recovery. This mutable-borrow helper leaves ownership with the
caller if abort fails.
§Examples
The caller supplies a retained recovery value from an operation.
use qubit_fs::error::FsResult;
use qubit_fs::write::{AsyncWriterRecovery, WriteAbortOutcome};
async fn abort_retained(
recovery: &mut AsyncWriterRecovery,
) -> FsResult<WriteAbortOutcome> {
match recovery {
AsyncWriterRecovery::Opened(writer) => writer.abort_async().await,
AsyncWriterRecovery::Rejected(writer) => writer.abort_async().await,
}
}Variants§
Opened(Box<AsyncFileWriter>)
A validated writer retained for explicit recovery.
Tuple Fields
§
0: Box<AsyncFileWriter>Validated writer that can perform writes, publication, or recovery.
Rejected(RejectedAsyncWriter)
A provider session whose returned identity failed validation.
Tuple Fields
§
0: RejectedAsyncWriterRejected provider session restricted to explicit cleanup.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncWriterRecovery
impl !Sync for AsyncWriterRecovery
impl !UnwindSafe for AsyncWriterRecovery
impl Forget for AsyncWriterRecovery
impl Freeze for AsyncWriterRecovery
impl Move for AsyncWriterRecovery
impl Send for AsyncWriterRecovery
impl Unpin for AsyncWriterRecovery
impl UnsafeUnpin for AsyncWriterRecovery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more