pub mod memory;
use async_trait::async_trait;
use crate::error::Result;
#[async_trait]
pub trait Store {
type Transaction: Transaction;
async fn begin_txn(&mut self) -> Result<Self::Transaction>;
}
#[async_trait]
pub trait Transaction: Send {
async fn get(&self, key: String) -> Result<Option<String>>;
async fn get_for_update(&mut self, key: String) -> Result<Option<String>>;
async fn put(&mut self, key: String, value: String) -> Result<()>;
async fn commit(&mut self) -> Result<()>;
async fn rollback(&mut self) -> Result<()> {
unimplemented!("this transaction does not support rollback");
}
}