pub struct RejectedAsyncWriter { /* private fields */ }Expand description
Isolated cleanup ownership after a provider returned an invalid identity.
This handle cannot write or publish. Cleanup acts only on resources owned by its session, never on a diagnostic path. Drop performs no explicit cleanup or cancellation hook; retain this handle until cleanup is confirmed.
use qubit_fs::write::RejectedAsyncWriter;
fn cannot_publish(mut recovery: RejectedAsyncWriter) {
recovery.commit();
}§Examples
use qubit_fs::Path;
use qubit_fs::write::AsyncWriterRecovery;
use qubit_fs::write::WriteOptions;
let mut operation = filesystem.begin_write_all(
Path::parse("/report")?, b"bytes".to_vec(), WriteOptions::default(),
)?;
let failure = operation
.execute()
.await
.expect_err("invalid provider identity");
let mut recovery = operation.take_recovery().expect("retained rejected session");
if let AsyncWriterRecovery::Rejected(writer) = &mut recovery {
assert!(writer.abort_async().await.is_ok());
}
drop(failure);Implementations§
Source§impl RejectedAsyncWriter
impl RejectedAsyncWriter
Sourcepub const fn cleanup_state(&self) -> RecoveryCleanupState
pub const fn cleanup_state(&self) -> RecoveryCleanupState
Returns cleanup progress; errors and cancellation do not release ownership.
Sourcepub fn abort_async(&mut self) -> SpiFuture<'_, FsResult<WriteAbortOutcome>>
pub fn abort_async(&mut self) -> SpiFuture<'_, FsResult<WriteAbortOutcome>>
Explicitly cleans resources actually owned by this isolated session.
A failed attempt retains the session for explicit retry or
reconciliation. No work occurs until polled. Dropping a polled,
unfinished future records Indeterminate; dropping an unpolled future
leaves the state unchanged. Cleanup completion is independent of
destination publication certainty:
Ok(WriteAbortOutcome::Indeterminate) confirms cleanup while
leaving the destination state unknown.
§Errors
Returns InvalidState after confirmed cleanup, or the contextual provider error without replacing the original opening failure.