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§
type ReadTransaction<'db>: ReadTransaction<'db> where Self: 'db
type WriteTransaction<'db>: WriteTransaction<'db> where Self: 'db
Required Methods§
Sourcefn create_regular_table<T: RegularTable>(&self, table: &T)
fn create_regular_table<T: RegularTable>(&self, table: &T)
Creates a regular table (no-duplicates).
Sourcefn create_dup_table<T: DupTable>(&self, table: &T)
fn create_dup_table<T: DupTable>(&self, table: &T)
Creates a table that can store duplicate keys.
Sourcefn read_transaction(&self) -> Self::ReadTransaction<'_>
fn read_transaction(&self) -> Self::ReadTransaction<'_>
Creates a read transaction.
Sourcefn write_transaction(&self) -> Self::WriteTransaction<'_>
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.