Skip to main content

RejectedWriter

Struct RejectedWriter 

Source
pub struct RejectedWriter { /* 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::RejectedWriter;
fn cannot_publish(mut recovery: RejectedWriter) {
    recovery.commit();
}

§Examples

use qubit_fs::error::FsResult;
use qubit_fs::write::RejectedWriter;
use qubit_fs::write::WriteAbortOutcome;

fn clean_up(recovery: &mut RejectedWriter) -> FsResult<WriteAbortOutcome> {
    // Keep the handle available if cleanup returns an error.
    recovery.abort()
}

Implementations§

Source§

impl RejectedWriter

Source

pub const fn cleanup_state(&self) -> RecoveryCleanupState

Returns cleanup progress; errors and cancellation do not release ownership.

§Returns

The latest cleanup state: Pending before cleanup, Running while an attempt is active, Completed after confirmed cleanup, or Indeterminate when cleanup did not finish conclusively. This cleanup state is independent of destination publication certainty; an Ok(WriteAbortOutcome::Indeterminate) confirms cleanup while leaving destination publication unknown.

Source

pub fn abort(&mut self) -> FsResult<WriteAbortOutcome>

Explicitly cleans resources actually owned by this isolated session.

A failed attempt retains the session for explicit retry or reconciliation. This synchronous method may block in provider I/O.

§Errors

Returns InvalidState after confirmed cleanup, or the contextual provider error without replacing the original opening failure.

§Returns

The outcome reported by the provider after cleanup completes.

Trait Implementations§

Source§

impl Debug for RejectedWriter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Omits the session and unvalidated provider identity.

§Parameters
  • f: Formatter receiving the diagnostic representation.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.