Trait modulus::disk::Disk [] [src]

pub trait Disk {
    fn read(&self, block: u64, count: u16, buffer: &mut [u8]);
    fn write(&self, block: u64, count: u16, buffer: &[u8]);
}

A storage disk

This is a trait implemented by specific disk types (ATA, ATAPI, SATA) for transferring data between a disk and memory.

Required Methods

fn read(&self, block: u64, count: u16, buffer: &mut [u8])

Read from disk

Read content from the disk at specified block. To read multiple blocks/sectors, change the count parameter to the chosen number of blocks. The buffer should be an array of u8s of size count * 512. This is where to received data will be written.

fn write(&self, block: u64, count: u16, buffer: &[u8])

Write to disk

Write content to the disk at specified block. To write multiple blocks/sectors, change the count parameter to the chosen number of blocks. The buffer should be an array of u8s of size count * 512. This is where the data to be written will be located.

Implementors