Struct mmap_storage::file::Storage[][src]

pub struct Storage { /* fields omitted */ }

File memory map backed storage.

Attempting to resize storage results in error.

Methods

impl Storage
[src]

Creates storage by opening or creating file at the specified location.

If file is newly created it is appended dummy byte.

Opens storage, if it doesn't exist return error.

Returns slice with view on written data.

Returns slice with view on written data.

Returns overall size of storage(including extra space).

Asynchronously flushes outstanding memory map modifications to disk.

This method initiates flushing modified pages to durable storage, but it will not wait for the operation to complete before returning.

Synchronously flushes outstanding memory map modifications to disk.

Resizes storage by appending or truncating.

It modifies file size and re-mmaps file.

Resizes map accordingly to data and copies it.

Convenience method to map buffer to file.

Appends data to storage

Note that it resizes storage if needed. Therefore error can happen.

Copies data from slice into storage.

Function panics if data has greater len.

Note: It copies data up to storage capacity.

Creates Vec from content of storage.

Trait Implementations

impl Write for Storage
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Attempts to write an entire buffer into this write. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

Auto Trait Implementations

impl Send for Storage

impl Sync for Storage