pub trait AsyncFileReadWriteVolatile {
    // Required methods
    fn async_read_at_volatile<'life0, 'async_trait>(
        &'life0 self,
        buf: FileVolatileBuf,
        offset: u64
    ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn async_read_vectored_at_volatile<'life0, 'async_trait>(
        &'life0 self,
        bufs: Vec<FileVolatileBuf>,
        offset: u64
    ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn async_write_at_volatile<'life0, 'async_trait>(
        &'life0 self,
        buf: FileVolatileBuf,
        offset: u64
    ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn async_write_vectored_at_volatile<'life0, 'async_trait>(
        &'life0 self,
        bufs: Vec<FileVolatileBuf>,
        offset: u64
    ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Extension of FileReadWriteVolatile to support io-uring based asynchronous IO.

The asynchronous IO framework provided by tokio-uring needs to take ownership of data buffers during asynchronous IO operations. The AsyncFileReadWriteVolatile trait is designed to support io-uring based asynchronous IO.

Required Methods§

source

fn async_read_at_volatile<'life0, 'async_trait>( &'life0 self, buf: FileVolatileBuf, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read bytes from this file at offset into the given slice in asynchronous mode.

Return the number of bytes read on success.

source

fn async_read_vectored_at_volatile<'life0, 'async_trait>( &'life0 self, bufs: Vec<FileVolatileBuf>, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Asynchronous version of FileReadWriteVolatile::read_vectored_at_volatile, to read data into FileVolatileSlice buffers.

Like async_read_at_volatile(), except it reads to a slice of buffers. Data is copied to fill each buffer in order, with the final buffer written to possibly being only partially filled. This method must behave as a single call to read_at_volatile with the buffers concatenated would.

Returns Ok(0) if none exists.

source

fn async_write_at_volatile<'life0, 'async_trait>( &'life0 self, buf: FileVolatileBuf, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Asynchronous version of FileReadWriteVolatile::write_at_volatile, to write data from a FileVolatileSlice buffer.

source

fn async_write_vectored_at_volatile<'life0, 'async_trait>( &'life0 self, bufs: Vec<FileVolatileBuf>, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Asynchronous version of FileReadWriteVolatile::write_vectored_at_volatile, to write data from FileVolatileSlice buffers.

Implementations on Foreign Types§

source§

impl<T: AsyncFileReadWriteVolatile + ?Sized> AsyncFileReadWriteVolatile for Arc<T>

source§

fn async_read_at_volatile<'life0, 'async_trait>( &'life0 self, buf: FileVolatileBuf, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn async_read_vectored_at_volatile<'life0, 'async_trait>( &'life0 self, bufs: Vec<FileVolatileBuf>, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn async_write_at_volatile<'life0, 'async_trait>( &'life0 self, buf: FileVolatileBuf, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn async_write_vectored_at_volatile<'life0, 'async_trait>( &'life0 self, bufs: Vec<FileVolatileBuf>, offset: u64 ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§