[][src]Trait rair_io::RIOPluginOperations

pub trait RIOPluginOperations {
    fn read(&mut self, raddr: usize, buffer: &mut [u8]) -> Result<(), IoError>;
fn write(&mut self, raddr: usize, buffer: &[u8]) -> Result<(), IoError>; }

A call to RIOPlugin::open would normally return [RioPluginDesc] that contains member that implements RIOPluginOperations. This way we always have way of reading and writing from file with custom data encoding.

Required methods

fn read(&mut self, raddr: usize, buffer: &mut [u8]) -> Result<(), IoError>

Function that read from a file represented by an object opened by RIOPlugin::open raddr is the real address of the in the file.

fn write(&mut self, raddr: usize, buffer: &[u8]) -> Result<(), IoError>

Function that writes to a file represented by an object opened by RIOPlugin::open raddr is the real address of the in the file.

Loading content...

Implementors

Loading content...