pub trait SharedFileType: AsyncRead + AsyncWrite {
    type Type;
    type OpenError;
    type SyncError;

    // Required methods
    fn open_ro<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Type, Self::OpenError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn open_rw<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Type, Self::OpenError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sync_all<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::SyncError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sync_data<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::SyncError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for types used as a file storage backend.

Required Associated Types§

source

type Type

The type created when producing a reader or writer. Typically Self.

source

type OpenError

The error type.

source

type SyncError

The error type.

Required Methods§

source

fn open_ro<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Type, Self::OpenError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Opens a new Type instance in read-only mode.

source

fn open_rw<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Type, Self::OpenError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Opens a new Type instance in read-write mode.

source

fn sync_all<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::SyncError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Synchronizes data and metadata with the underlying buffer.

source

fn sync_data<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::SyncError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Synchronizes data with the underlying buffer.

Implementations on Foreign Types§

source§

impl SharedFileType for TempFile

Available on crate feature async-tempfile only.
§

type Type = TempFile

§

type OpenError = Error

§

type SyncError = CompleteWritingError

source§

fn open_ro<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Type, Self::OpenError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn open_rw<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Type, Self::OpenError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn sync_all<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::SyncError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn sync_data<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::SyncError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Implementors§