Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

Block

Trait Block 

Source
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§

Source

fn read_frame(&mut self, frame: u16, out: &mut [u8; 128]) -> Result<()>

Read frame frame (0..FRAME_COUNT) into out.

Source

fn write_frame(&mut self, frame: u16, data: &[u8; 128]) -> Result<()>

Write data to frame frame (0..FRAME_COUNT).

Implementors§