pub trait SyncBlockDevice {
    // Required methods
    fn num_blocks(&self) -> u64;
    fn read_block(
        &mut self,
        block_no: u64,
        buf: &mut [u8]
    ) -> Result<(), FsError>;
    fn write_block(&mut self, block_no: u64, buf: &[u8]) -> Result<(), FsError>;
}
Expand description

Synchronous Block Device.

Required Methods§

source

fn num_blocks(&self) -> u64

The number of blocks in this device.

source

fn read_block(&mut self, block_no: u64, buf: &mut [u8]) -> Result<(), FsError>

Read a single block into buf. buf must be aligned to BLOCK_SIZE and of length BLOCK_SIZE.

source

fn write_block(&mut self, block_no: u64, buf: &[u8]) -> Result<(), FsError>

Write a single block. Same alignment requirements as in read_block.

Implementors§