pub struct EventSourcingRepository<T> { /* private fields */ }Expand description
Event sourcing repository for managing aggregates
Implementations§
Source§impl<T> EventSourcingRepository<T>
impl<T> EventSourcingRepository<T>
pub fn new(event_store: Arc<dyn EventStore + Send + Sync>) -> Self
pub fn with_snapshot_frequency(self, frequency: u64) -> Self
Sourcepub async fn load(&self, aggregate_id: &AggregateId) -> Result<Option<T>>
pub async fn load(&self, aggregate_id: &AggregateId) -> Result<Option<T>>
Load aggregate from event store
Sourcepub async fn exists(&self, aggregate_id: &AggregateId) -> Result<bool>
pub async fn exists(&self, aggregate_id: &AggregateId) -> Result<bool>
Check if aggregate exists
Auto Trait Implementations§
impl<T> Freeze for EventSourcingRepository<T>
impl<T> !RefUnwindSafe for EventSourcingRepository<T>
impl<T> Send for EventSourcingRepository<T>where
T: Send,
impl<T> Sync for EventSourcingRepository<T>where
T: Sync,
impl<T> Unpin for EventSourcingRepository<T>where
T: Unpin,
impl<T> !UnwindSafe for EventSourcingRepository<T>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more