Skip to main content

AsyncFileWriteSession

Trait AsyncFileWriteSession 

Source
pub trait AsyncFileWriteSession: AsyncOutput<Item = u8> + Send {
    // Required methods
    fn commit_async<'a>(
        self: Pin<&'a mut Self>,
    ) -> SpiFuture<'a, Result<WriteOutcome, WriteFailure>>;
    fn abort_async<'a>(
        self: Pin<&'a mut Self>,
    ) -> SpiFuture<'a, FsResult<WriteAbortOutcome>>;

    // Provided method
    fn cancel_on_drop(self: Pin<&mut Self>) { ... }
}
Expand description

Provider session underlying a concrete crate::write::AsyncFileWriter handle.

§Examples

use qubit_fs::spi::AsyncFileWriteSession;

fn accepts_session<T: AsyncFileWriteSession>() {}

Required Methods§

Source

fn commit_async<'a>( self: Pin<&'a mut Self>, ) -> SpiFuture<'a, Result<WriteOutcome, WriteFailure>>

Asynchronously publishes bytes accepted by the session.

§Returns

A future resolving to the actual publication method and atomicity, or a typed failure that preserves provider-confirmed publication progress.

§Errors

Resolves to a typed write failure when publication cannot be confirmed.

Source

fn abort_async<'a>( self: Pin<&'a mut Self>, ) -> SpiFuture<'a, FsResult<WriteAbortOutcome>>

Asynchronously cancels and cleans up this write session.

§Returns

A future resolving when cleanup is confirmed.

§Errors

Resolves to the provider cleanup failure with filesystem context.

Provided Methods§

Source

fn cancel_on_drop(self: Pin<&mut Self>)

Performs nonblocking local cancellation during writer drop.

The default does nothing. Implementations must not start or block an executor, wait for network I/O, or claim remote cleanup completed.

§Parameters
  • self: Pinned provider session being abandoned.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§