Skip to main content

SharedFileType

Trait SharedFileType 

Source
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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SharedFileType for TempFile

Available on crate feature async-tempfile only.
Source§

type Type = TempFile

Source§

type OpenError = Error

Source§

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§