[][src]Struct flatdata::FileResourceStorage

pub struct FileResourceStorage { /* fields omitted */ }

Resource storage on disk using memory mapped files.

Can be used to create and read archives from the file system.

Examples

This example is not tested
let storage = FileResourceStorage::new(PathBuf::from("/root/to/my/archive"));
let _builder = XBuilder::new(storage.clone()).expect("failed to create builder");
// Write some data, store archive, etc...

let _archive = X::open(storage).expect("failed to open");
// read some data

Methods

impl FileResourceStorage[src]

pub fn new<P: Into<PathBuf>>(path: P) -> Rc<Self>[src]

Create an empty memory mapped file storage at a given path.

Trait Implementations

impl ResourceStorage for FileResourceStorage[src]

fn read(
    &self,
    resource_name: &str,
    schema: &str
) -> Result<&[u8], ResourceStorageError>
[src]

Open a flatdata resource with given name and schema for reading. Read more

fn write(&self, resource_name: &str, schema: &str, data: &[u8]) -> Result<()>[src]

Writes data of a flatdata resource with given name and schema to storage. Read more

fn read_and_check_schema(
    &self,
    resource_name: &str,
    expected_schema: &str
) -> Result<&[u8], ResourceStorageError>
[src]

Implementation helper for [read]. Read more

impl Debug for FileResourceStorage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]