Remove RwLock around stores, locking shall be the responsibility of the store implementation

This commit is contained in:
Lennart
2024-10-27 15:36:49 +01:00
parent df8790f46d
commit 858f43de67
31 changed files with 119 additions and 236 deletions

View File

@@ -10,19 +10,19 @@ pub trait AddressbookStore: Send + Sync + 'static {
async fn get_addressbooks(&self, principal: &str) -> Result<Vec<Addressbook>, Error>;
async fn update_addressbook(
&mut self,
&self,
principal: String,
id: String,
addressbook: Addressbook,
) -> Result<(), Error>;
async fn insert_addressbook(&mut self, addressbook: Addressbook) -> Result<(), Error>;
async fn insert_addressbook(&self, addressbook: Addressbook) -> Result<(), Error>;
async fn delete_addressbook(
&mut self,
&self,
principal: &str,
name: &str,
use_trashbin: bool,
) -> Result<(), Error>;
async fn restore_addressbook(&mut self, principal: &str, name: &str) -> Result<(), Error>;
async fn restore_addressbook(&self, principal: &str, name: &str) -> Result<(), Error>;
async fn sync_changes(
&self,
@@ -43,20 +43,21 @@ pub trait AddressbookStore: Send + Sync + 'static {
object_id: &str,
) -> Result<AddressObject, Error>;
async fn put_object(
&mut self,
&self,
principal: String,
addressbook_id: String,
object: AddressObject,
overwrite: bool,
) -> Result<(), Error>;
async fn delete_object(
&mut self,
&self,
principal: &str,
addressbook_id: &str,
object_id: &str,
use_trashbin: bool,
) -> Result<(), Error>;
async fn restore_object(
&mut self,
&self,
principal: &str,
addressbook_id: &str,
object_id: &str,