Skip to main content

Database

Trait Database 

Source
pub trait Database: Sized {
    type ReadTransaction<'db>: ReadTransaction<'db>
       where Self: 'db;
    type WriteTransaction<'db>: WriteTransaction<'db>
       where Self: 'db;

    // Required methods
    fn create_regular_table<T: RegularTable>(&self, table: &T);
    fn create_dup_table<T: DupTable>(&self, table: &T);
    fn read_transaction(&self) -> Self::ReadTransaction<'_>;
    fn write_transaction(&self) -> Self::WriteTransaction<'_>;
}
Expand description

A database handle that can hold multiple tables.

Required Associated Types§

Source

type ReadTransaction<'db>: ReadTransaction<'db> where Self: 'db

Source

type WriteTransaction<'db>: WriteTransaction<'db> where Self: 'db

Required Methods§

Source

fn create_regular_table<T: RegularTable>(&self, table: &T)

Creates a regular table (no-duplicates).

Source

fn create_dup_table<T: DupTable>(&self, table: &T)

Creates a table that can store duplicate keys.

Source

fn read_transaction(&self) -> Self::ReadTransaction<'_>

Creates a read transaction.

Source

fn write_transaction(&self) -> Self::WriteTransaction<'_>

Creates a read/write transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§