diff --git a/src/store/mod.rs b/src/store/mod.rs index 9f2845ac..ea9cb785 100644 --- a/src/store/mod.rs +++ b/src/store/mod.rs @@ -68,17 +68,18 @@ pub trait EventStore { async fn delete(&self, aggregate_id: Uuid) -> Result<(), Self::Error>; } -/// Default generic implementation for every type implementing [`Deref`] where its `Target` is a -/// `dyn` [`EventStore`]. This is particularly useful when there's the need in your codebase to have -/// a generic [`EventStore`]. +/// Blanket implementation making an [`EventStore`] every (smart) pointer to an [`EventStore`], +/// e.g. `&Store`, `Box`, `Arc`. +/// This is particularly useful when there's the need in your codebase to have a generic [`EventStore`]. #[async_trait] -impl EventStore for T +impl EventStore for T where A: crate::Aggregate, A::Event: Send + Sync, A::State: Send, E: std::error::Error, - T: Deref + Sync> + Sync, + S: EventStore + ?Sized, + T: Deref + Sync, for<'a> A::Event: 'a, { type Aggregate = A;