[][src]Trait libimagstore::file_abstraction::FileAbstractionInstance

pub trait FileAbstractionInstance: Debug {
    fn get_file_content(&mut self, id: StoreId) -> Result<Option<Entry>>;
fn write_file_content(&mut self, buf: &Entry) -> Result<()>; }

An abstraction trait over actions on files

Required methods

fn get_file_content(&mut self, id: StoreId) -> Result<Option<Entry>>

Get the contents of the FileAbstractionInstance, as Entry object.

The StoreId is passed because the backend does not know where the Entry lives, but the Entry type itself must be constructed with the id.

fn write_file_content(&mut self, buf: &Entry) -> Result<()>

Loading content...

Implementors

impl FileAbstractionInstance for FSFileAbstractionInstance[src]

fn get_file_content(&mut self, id: StoreId) -> Result<Option<Entry>>[src]

Get the content behind this file

fn write_file_content(&mut self, buf: &Entry) -> Result<()>[src]

Write the content of this file

impl FileAbstractionInstance for InMemoryFileAbstractionInstance[src]

fn get_file_content(&mut self, _: StoreId) -> Result<Option<Entry>>[src]

Get the mutable file behind a InMemoryFileAbstraction object

Loading content...