pub trait AsyncBlockBackend: Send + Sync {
// Required methods
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
sector: u64,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
sector: u64,
buf: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn capacity(&self) -> u64;
fn is_read_only(&self) -> bool;
}Expand description
Async block I/O backend trait.
Required Methods§
Sourcefn read<'life0, 'life1, 'async_trait>(
&'life0 self,
sector: u64,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
sector: u64,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Reads data from the given sector.
Sourcefn write<'life0, 'life1, 'async_trait>(
&'life0 self,
sector: u64,
buf: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
sector: u64,
buf: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Writes data to the given sector.
Sourcefn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Flushes pending writes.
Sourcefn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Returns whether the device is read-only.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".