pub trait IDatabase:
Debug
+ MaybeSend
+ MaybeSync
+ 'static {
// Required methods
fn begin_transaction<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn IDatabaseTransaction + 'a>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
fn register<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_global(&self) -> bool;
fn checkpoint(&self, backup_path: &Path) -> Result<()>;
}
Expand description
A database that on top of a raw database operation, implements key notification system.
Required Methods§
sourcefn begin_transaction<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn IDatabaseTransaction + 'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn begin_transaction<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn IDatabaseTransaction + 'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Start a database transaction
sourcefn register<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register (and wait) for key
updates
sourcefn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Notify about key
update (creation, modification, deletion)
sourcefn is_global(&self) -> bool
fn is_global(&self) -> bool
The prefix len of this database refers to the global (as opposed to module-isolated) key space
sourcefn checkpoint(&self, backup_path: &Path) -> Result<()>
fn checkpoint(&self, backup_path: &Path) -> Result<()>
Checkpoints the database to a backup directory