IO

Trait IO 

Source
pub trait IO {
    type Error: Debug;

    // Required methods
    fn set_sector_size_shift(&mut self, shift: u8) -> Result<(), Self::Error>;
    fn read<'a>(&'a mut self, id: SectorID) -> Result<&'a [Block], Self::Error>;
    fn write(
        &mut self,
        id: SectorID,
        offset: usize,
        data: &[u8],
    ) -> Result<(), Self::Error>;
    fn flush(&mut self) -> Result<(), Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn set_sector_size_shift(&mut self, shift: u8) -> Result<(), Self::Error>

Default to 9, which means 512B

Source

fn read<'a>(&'a mut self, id: SectorID) -> Result<&'a [Block], Self::Error>

Source

fn write( &mut self, id: SectorID, offset: usize, data: &[u8], ) -> Result<(), Self::Error>

Caller guarantees bytes.len() <= SECTOR_SIZE - offset

Source

fn flush(&mut self) -> Result<(), Self::Error>

Implementors§