mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 05:52:19 +00:00
dav: add default implementation for save_resource
This commit is contained in:
@@ -185,10 +185,6 @@ impl<C: CalendarStore + ?Sized> ResourceService for CalendarObjectResourceServic
|
||||
})
|
||||
}
|
||||
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(Error::NotImplemented)
|
||||
}
|
||||
|
||||
async fn delete_resource(&self, use_trashbin: bool) -> Result<(), Self::Error> {
|
||||
self.cal_store
|
||||
.delete_object(&self.principal, &self.cal_id, &self.object_id, use_trashbin)
|
||||
|
||||
@@ -170,8 +170,4 @@ impl<C: CalendarStore + ?Sized> ResourceService for PrincipalResourceService<C>
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(Error::NotImplemented)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +107,4 @@ impl ResourceService for RootResourceService {
|
||||
async fn get_resource(&self) -> Result<Self::Resource, Self::Error> {
|
||||
Ok(RootResource)
|
||||
}
|
||||
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(Error::NotImplemented)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,10 +186,6 @@ impl<AS: AddressbookStore + ?Sized> ResourceService for AddressObjectResourceSer
|
||||
})
|
||||
}
|
||||
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(Error::NotImplemented)
|
||||
}
|
||||
|
||||
async fn delete_resource(&self, use_trashbin: bool) -> Result<(), Self::Error> {
|
||||
self.addr_store
|
||||
.delete_object(&self.principal, &self.cal_id, &self.object_id, use_trashbin)
|
||||
|
||||
@@ -171,8 +171,4 @@ impl<A: AddressbookStore + ?Sized> ResourceService for PrincipalResourceService<
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(Error::NotImplemented)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,8 +100,4 @@ impl ResourceService for RootResourceService {
|
||||
async fn get_resource(&self) -> Result<Self::Resource, Self::Error> {
|
||||
Ok(RootResource)
|
||||
}
|
||||
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(Error::NotImplemented)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,9 @@ pub trait ResourceService: Sized + 'static {
|
||||
}
|
||||
|
||||
async fn get_resource(&self) -> Result<Self::Resource, Self::Error>;
|
||||
async fn save_resource(&self, file: Self::Resource) -> Result<(), Self::Error>;
|
||||
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
|
||||
Err(crate::Error::Unauthorized.into())
|
||||
}
|
||||
async fn delete_resource(&self, _use_trashbin: bool) -> Result<(), Self::Error> {
|
||||
Err(crate::Error::Unauthorized.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user