Trait BlockDevice

Source
pub trait BlockDevice {
    // Required method
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        offset: u64,
        buf: &'life1 mut [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn write<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _offset: u64,
        _buf: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn flush<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn trim<'life0, 'async_trait>(
        &'life0 mut self,
        _offset: u64,
        _size: usize,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A block device.

Required Methods§

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 mut self, offset: u64, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read a block from offset.

Provided Methods§

Source

fn write<'life0, 'life1, 'async_trait>( &'life0 mut self, _offset: u64, _buf: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Write a block of data at offset.

Source

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

Flushes write buffers to the underlying storage medium

Source

fn trim<'life0, 'async_trait>( &'life0 mut self, _offset: u64, _size: usize, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Marks blocks as unused

Implementors§