BlockDevice

Trait BlockDevice 

Source
pub trait BlockDevice {
    // Required method
    fn read_block(&self, block: u32, buf: &mut [u8; 512]) -> Result<(), ()>;
}
Expand description

Block device trait for reading blocks from storage.

Implement this trait for your storage medium (file, memory, hardware, etc.).

Required Methods§

Source

fn read_block(&self, block: u32, buf: &mut [u8; 512]) -> Result<(), ()>

Read a single 512-byte block.

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

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

Implementors§