[][src]Trait usbd_scsi::BlockDevice

pub trait BlockDevice {
    const BLOCK_BYTES: usize;

    fn read_block(
        &self,
        lba: u32,
        block: &mut [u8]
    ) -> Result<(), BlockDeviceError>;
fn write_block(
        &mut self,
        lba: u32,
        block: &[u8]
    ) -> Result<(), BlockDeviceError>;
fn max_lba(&self) -> u32; }

Associated Constants

const BLOCK_BYTES: usize

The number of bytes per block. This determines the size of the buffer passed to read/write functions

Loading content...

Required methods

fn read_block(&self, lba: u32, block: &mut [u8]) -> Result<(), BlockDeviceError>

Read the block indicated by lba into the provided buffer

fn write_block(
    &mut self,
    lba: u32,
    block: &[u8]
) -> Result<(), BlockDeviceError>

Write the block buffer to the block indicated by lba

fn max_lba(&self) -> u32

Get the maxium valid lba (logical block address)

Loading content...

Implementors

Loading content...