Trait lightning_storage_server::database::Database
source · pub trait Database: Send + Sync {
// Required methods
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client_id: &'life1 [u8],
kvs: &'life2 Vec<(String, Value)>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_with_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
client_id: &'life1 [u8],
key_prefix: String
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Value)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Methods§
sourcefn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client_id: &'life1 [u8],
kvs: &'life2 Vec<(String, Value)>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, client_id: &'life1 [u8], kvs: &'life2 Vec<(String, Value)> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Atomically put a vector of key-values into the database.
If any of the value versions are not the next version, the entire transaction is aborted and the error includes the existing values.
sourcefn get_with_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
client_id: &'life1 [u8],
key_prefix: String
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Value)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_with_prefix<'life0, 'life1, 'async_trait>( &'life0 self, client_id: &'life1 [u8], key_prefix: String ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Value)>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Get all keys matching a prefix from the database