pub trait BlockDevice {
// Required methods
fn read_sector(&self, sector: u64, buf: &mut [u8]) -> Result<(), BlockError>;
fn write_sector(&self, sector: u64, buf: &[u8]) -> Result<(), BlockError>;
fn sector_count(&self) -> u64;
}Expand description
Block device trait (implemented by VirtIO-blk driver)
Required Methods§
Sourcefn read_sector(&self, sector: u64, buf: &mut [u8]) -> Result<(), BlockError>
fn read_sector(&self, sector: u64, buf: &mut [u8]) -> Result<(), BlockError>
Read sectors from the device
Sourcefn write_sector(&self, sector: u64, buf: &[u8]) -> Result<(), BlockError>
fn write_sector(&self, sector: u64, buf: &[u8]) -> Result<(), BlockError>
Write sectors to the device
Sourcefn sector_count(&self) -> u64
fn sector_count(&self) -> u64
Get the total number of sectors