pub trait Block {
// Required methods
fn read_frame(&mut self, frame: u16, out: &mut [u8; 128]) -> Result<()>;
fn write_frame(&mut self, frame: u16, data: &[u8; 128]) -> Result<()>;
}Expand description
A card as a flat array of FRAME_COUNT 128-byte frames.
This is the seam between the hardware and the filesystem: implement it once
per backing (real card, RAM image, a file on a host) and the whole Card
filesystem works unchanged.
Required Methods§
Sourcefn read_frame(&mut self, frame: u16, out: &mut [u8; 128]) -> Result<()>
fn read_frame(&mut self, frame: u16, out: &mut [u8; 128]) -> Result<()>
Read frame frame (0..FRAME_COUNT) into out.
Sourcefn write_frame(&mut self, frame: u16, data: &[u8; 128]) -> Result<()>
fn write_frame(&mut self, frame: u16, data: &[u8; 128]) -> Result<()>
Write data to frame frame (0..FRAME_COUNT).