sel4_async_block_io_fat

Trait BlockDevice

Source
pub trait BlockDevice {
    type Error: Debug;

    // Required methods
    async fn read(
        &self,
        blocks: &mut [Block],
        start_block_idx: BlockIdx,
        reason: &str,
    ) -> Result<(), Self::Error>;
    async fn write(
        &self,
        blocks: &[Block],
        start_block_idx: BlockIdx,
    ) -> Result<(), Self::Error>;
    async fn num_blocks(&self) -> Result<BlockCount, Self::Error>;
}
Expand description

Represents a block device - a device which can read and write blocks (or sectors). Only supports devices which are <= 2 TiB in size.

Required Associated Types§

Source

type Error: Debug

The errors that the BlockDevice can return. Must be debug formattable.

Required Methods§

Source

async fn read( &self, blocks: &mut [Block], start_block_idx: BlockIdx, reason: &str, ) -> Result<(), Self::Error>

Read one or more blocks, starting at the given block index.

Source

async fn write( &self, blocks: &[Block], start_block_idx: BlockIdx, ) -> Result<(), Self::Error>

Write one or more blocks, starting at the given block index.

Source

async fn num_blocks(&self) -> Result<BlockCount, Self::Error>

Determine how many blocks this device can hold.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: BlockIO<A, BlockSize = BlockSize512>, A: Access> BlockDevice for BlockIOWrapper<T, A>

Source§

type Error = Infallible