Trait SyncBlockDevice

Source
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§