nimiq_database/traits/
database.rs1use super::{DupTable, ReadTransaction, RegularTable, WriteTransaction};
2
3pub trait Database: Sized {
5 type ReadTransaction<'db>: ReadTransaction<'db>
6 where
7 Self: 'db;
8 type WriteTransaction<'db>: WriteTransaction<'db>
9 where
10 Self: 'db;
11
12 fn create_regular_table<T: RegularTable>(&self, table: &T);
14
15 fn create_dup_table<T: DupTable>(&self, table: &T);
17
18 fn read_transaction(&self) -> Self::ReadTransaction<'_>;
20
21 fn write_transaction(&self) -> Self::WriteTransaction<'_>;
23}