SectorDevice

Trait SectorDevice 

Source
pub trait SectorDevice {
    // Required method
    fn read_sector(&self, sector: u64, buf: &mut [u8; 512]) -> Result<(), ()>;
}
Expand description

Sector device trait for reading 512-byte sectors.

This is used for variable block size support, where the filesystem block size may be larger than 512 bytes. The reader will read multiple sectors to assemble a full block.

Required Methods§

Source

fn read_sector(&self, sector: u64, buf: &mut [u8; 512]) -> Result<(), ()>

Read a single 512-byte sector.

§Arguments
  • sector - Sector number to read
  • buf - Buffer to read into (must be exactly 512 bytes)
§Returns

Ok(()) on success, Err(()) on failure.

Implementors§

Source§

impl<T: BlockDevice> SectorDevice for T

Blanket implementation: any BlockDevice is also a SectorDevice.