diff --git a/src/calendar/cached_calendar.rs b/src/calendar/cached_calendar.rs index 9b4d405..9e09fac 100644 --- a/src/calendar/cached_calendar.rs +++ b/src/calendar/cached_calendar.rs @@ -137,6 +137,10 @@ impl DavCalendar for CachedCalendar { Ok(result) } + async fn get_item_by_id(&self, id: &ItemId) -> Result, Box> { + Ok(self.items.get(id).cloned()) + } + async fn delete_item(&mut self, item_id: &ItemId) -> Result<(), Box> { self.immediately_delete_item(item_id).await } diff --git a/src/traits.rs b/src/traits.rs index c558a59..74859b2 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -54,6 +54,9 @@ pub trait DavCalendar : BaseCalendar { /// Get the IDs and the version tags of every item in this calendar async fn get_item_version_tags(&self) -> Result, Box>; + /// Returns a particular item + async fn get_item_by_id(&self, id: &ItemId) -> Result, Box>; + /// Delete an item async fn delete_item(&mut self, item_id: &ItemId) -> Result<(), Box>; @@ -64,9 +67,6 @@ pub trait DavCalendar : BaseCalendar { .map(|(id, _tag)| id.clone()) .collect()) } - - /// Returns a particular item - async fn get_item_by_id(&self, id: &ItemId) -> Result, Box>; }