[][src]Trait sunrise_libuser::fs::IStorage

pub trait IStorage {
    fn read(
        &mut self,
        manager: WorkQueue<'static>,
        offset: u64,
        length: u64,
        out_buf: &mut [u8]
    ) -> Result<(), Error>;
fn write(
        &mut self,
        manager: WorkQueue<'static>,
        offset: u64,
        length: u64,
        in_buf: &[u8]
    ) -> Result<(), Error>;
fn flush(&mut self, manager: WorkQueue<'static>) -> Result<(), Error>;
fn set_size(
        &mut self,
        manager: WorkQueue<'static>,
        size: u64
    ) -> Result<(), Error>;
fn get_size(&mut self, manager: WorkQueue<'static>) -> Result<u64, Error>; fn dispatch<'a>(
        &'a mut self,
        manager: WorkQueue<'static>,
        cmdid: u32,
        buf: &'a mut [u8]
    ) -> FutureObj<Result<(), Error>> { ... } }

This is the interface for a raw device, usually a block device.

Required methods

fn read(
    &mut self,
    manager: WorkQueue<'static>,
    offset: u64,
    length: u64,
    out_buf: &mut [u8]
) -> Result<(), Error>

Read the content of a storage at a given offset in out_buf.

fn write(
    &mut self,
    manager: WorkQueue<'static>,
    offset: u64,
    length: u64,
    in_buf: &[u8]
) -> Result<(), Error>

Write the content given in_buf at the given offset in the file.

fn flush(&mut self, manager: WorkQueue<'static>) -> Result<(), Error>

Flush any data not written on the storage.

fn set_size(
    &mut self,
    manager: WorkQueue<'static>,
    size: u64
) -> Result<(), Error>

Resize the storage with the given size.

fn get_size(&mut self, manager: WorkQueue<'static>) -> Result<u64, Error>

Return the current storage size.

Loading content...

Provided methods

fn dispatch<'a>(
    &'a mut self,
    manager: WorkQueue<'static>,
    cmdid: u32,
    buf: &'a mut [u8]
) -> FutureObj<Result<(), Error>>

Handle an incoming IPC request.

Loading content...

Implementors

Loading content...