Skip to main content

DatabaseStorage

Trait DatabaseStorage 

Source
pub trait DatabaseStorage: Send + Sync {
    // Required methods
    fn read_page(&self, page_idx: usize, c: Arc<Completion>) -> Result<()>;
    fn write_page(
        &self,
        page_idx: usize,
        buffer: Arc<RefCell<Buffer>>,
        c: Arc<Completion>,
    ) -> Result<()>;
    fn sync(&self, c: Arc<Completion>) -> Result<()>;
}
Expand description

DatabaseStorage is an interface a database file that consists of pages.

The purpose of this trait is to abstract the upper layers of Limbo from the storage medium. A database can either be a file on disk, like in SQLite, or something like a remote page server service.

Required Methods§

Source

fn read_page(&self, page_idx: usize, c: Arc<Completion>) -> Result<()>

Source

fn write_page( &self, page_idx: usize, buffer: Arc<RefCell<Buffer>>, c: Arc<Completion>, ) -> Result<()>

Source

fn sync(&self, c: Arc<Completion>) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§