[−][src]Struct flatdata::FileResourceStorage
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 subdir(&self, dir: &str) -> Rc<dyn ResourceStorage>[src]
fn exists(&self, resource_name: &str) -> bool[src]
fn read_resource(&self, resource_name: &str) -> Result<&[u8], Error>[src]
fn create_output_stream(
&self,
resource_name: &str
) -> Result<Rc<RefCell<dyn Stream>>, Error>[src]
&self,
resource_name: &str
) -> Result<Rc<RefCell<dyn Stream>>, Error>
fn read(
&self,
resource_name: &str,
schema: &str
) -> Result<&[u8], ResourceStorageError>[src]
&self,
resource_name: &str,
schema: &str
) -> Result<&[u8], ResourceStorageError>
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]
&self,
resource_name: &str,
expected_schema: &str
) -> Result<&[u8], ResourceStorageError>
Implementation helper for [read]. Read more
impl Debug for FileResourceStorage[src]
Auto Trait Implementations
impl !Sync for FileResourceStorage
impl Unpin for FileResourceStorage
impl Send for FileResourceStorage
impl !RefUnwindSafe for FileResourceStorage
impl UnwindSafe for FileResourceStorage
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,