Trait kdevice::block::BlockBus[][src]

pub trait BlockBus {
    fn probe(&mut self) -> Result<()>;
fn read(&mut self, bno: usize, buf: &mut [u8]) -> Result<()>;
fn write(&mut self, bno: usize, buf: &[u8]) -> Result<()>; }
Expand description

Block device trait that you need to implement for each slot.

For each instance, all three methods are guaranteed to becalled exlusively.

Required methods

fn probe(&mut self) -> Result<()>[src]

Return Ok if the bus is active.

fn read(&mut self, bno: usize, buf: &mut [u8]) -> Result<()>[src]

Read a block from the block device.

fn write(&mut self, bno: usize, buf: &[u8]) -> Result<()>[src]

Write a block to the block device.

Implementors