Add ?Sized to CalendarStore generics for dynamic dispatch

This commit is contained in:
Lennart
2023-10-08 14:47:36 +02:00
parent e17e4facd7
commit f6cf5bd645
8 changed files with 21 additions and 18 deletions

View File

@@ -9,14 +9,14 @@ use rustical_store::event::Event;
use std::sync::Arc;
use tokio::sync::RwLock;
pub struct EventResource<C: CalendarStore> {
pub struct EventResource<C: CalendarStore + ?Sized> {
pub cal_store: Arc<RwLock<C>>,
pub path: String,
pub event: Event,
}
#[async_trait(?Send)]
impl<C: CalendarStore> Resource for EventResource<C> {
impl<C: CalendarStore + ?Sized> Resource for EventResource<C> {
type UriComponents = (String, String, String); // principal, calendar, event
type MemberType = Self;