mirror of
https://github.com/serai-dex/serai.git
synced 2025-03-21 06:38:56 +00:00
must_use annotations on DbTxn
This commit is contained in:
parent
695d923593
commit
c032f66f8a
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ pub trait Get: Send + Sync + Debug {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An atomic database operation.
|
/// An atomic database operation.
|
||||||
|
#[must_use]
|
||||||
pub trait DbTxn: Send + Sync + Debug + Get {
|
pub trait DbTxn: Send + Sync + Debug + Get {
|
||||||
fn put(&mut self, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>);
|
fn put(&mut self, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>);
|
||||||
fn del(&mut self, key: impl AsRef<[u8]>);
|
fn del(&mut self, key: impl AsRef<[u8]>);
|
||||||
|
@ -29,6 +30,7 @@ pub trait Db: 'static + Send + Sync + Clone + Debug + Get {
|
||||||
|
|
||||||
/// An atomic operation for the in-memory databae.
|
/// An atomic operation for the in-memory databae.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[must_use]
|
||||||
pub struct MemDbTxn<'a>(&'a MemDb, HashMap<Vec<u8>, Vec<u8>>, HashSet<Vec<u8>>);
|
pub struct MemDbTxn<'a>(&'a MemDb, HashMap<Vec<u8>, Vec<u8>>, HashSet<Vec<u8>>);
|
||||||
|
|
||||||
impl<'a> Get for MemDbTxn<'a> {
|
impl<'a> Get for MemDbTxn<'a> {
|
||||||
|
|
Loading…
Reference in a new issue