pub struct CompositeEntitySource<'e, 's, A, E, ES, SS>{ /* private fields */ }
Expand description
Combines an EventSource
and a SnapshotSource
of different types by reference
so that they can be used jointly as an EntitySource.
Implementations§
Source§impl<'e, 's, A, E, ES, SS> CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> CompositeEntitySource<'e, 's, A, E, ES, SS>
Sourcepub fn with_event_source<'new_e, NewES>(
self,
event_source: &'new_e NewES,
) -> CompositeEntitySource<'new_e, 's, A, E, NewES, SS>where
NewES: EventSource<A, E> + 'new_e,
pub fn with_event_source<'new_e, NewES>(
self,
event_source: &'new_e NewES,
) -> CompositeEntitySource<'new_e, 's, A, E, NewES, SS>where
NewES: EventSource<A, E> + 'new_e,
Attaches a specific event source.
Sourcepub fn with_snapshot_source<'new_s, NewSS>(
self,
snapshot_source: &'new_s NewSS,
) -> CompositeEntitySource<'e, 'new_s, A, E, ES, NewSS>where
NewSS: SnapshotSource<A> + 'new_s,
pub fn with_snapshot_source<'new_s, NewSS>(
self,
snapshot_source: &'new_s NewSS,
) -> CompositeEntitySource<'e, 'new_s, A, E, ES, NewSS>where
NewSS: SnapshotSource<A> + 'new_s,
Attaches a specific snapshot source.
Trait Implementations§
Source§impl<'e, 's, A, E, ES, SS> Clone for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + Clone,
E: AggregateEvent<A> + Clone,
ES: EventSource<A, E> + 'e + Clone,
SS: SnapshotSource<A> + 's + Clone,
impl<'e, 's, A, E, ES, SS> Clone for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + Clone,
E: AggregateEvent<A> + Clone,
ES: EventSource<A, E> + 'e + Clone,
SS: SnapshotSource<A> + 's + Clone,
Source§fn clone(&self) -> CompositeEntitySource<'e, 's, A, E, ES, SS>
fn clone(&self) -> CompositeEntitySource<'e, 's, A, E, ES, SS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'e, 's, A, E, ES, SS> Debug for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + Debug,
E: AggregateEvent<A> + Debug,
ES: EventSource<A, E> + 'e + Debug,
SS: SnapshotSource<A> + 's + Debug,
impl<'e, 's, A, E, ES, SS> Debug for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + Debug,
E: AggregateEvent<A> + Debug,
ES: EventSource<A, E> + 'e + Debug,
SS: SnapshotSource<A> + 's + Debug,
Source§impl<A, E> Default for CompositeEntitySource<'static, 'static, A, E, NullEventStore<A, E>, NullSnapshotStore<A>>where
A: Aggregate,
E: AggregateEvent<A>,
impl<A, E> Default for CompositeEntitySource<'static, 'static, A, E, NullEventStore<A, E>, NullSnapshotStore<A>>where
A: Aggregate,
E: AggregateEvent<A>,
Source§impl<'e, 's, A, E, ES, SS> EventSource<A, E> for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> EventSource<A, E> for CompositeEntitySource<'e, 's, A, E, ES, SS>
Source§type Error = <ES as EventSource<A, E>>::Error
type Error = <ES as EventSource<A, E>>::Error
The error type.
Source§type Events = <ES as EventSource<A, E>>::Events
type Events = <ES as EventSource<A, E>>::Events
Represents the sequence of events read from the event source.
Source§impl<'e, 's, A, E, ES, SS> PartialEq for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + PartialEq,
E: AggregateEvent<A> + PartialEq,
ES: EventSource<A, E> + 'e + PartialEq,
SS: SnapshotSource<A> + 's + PartialEq,
impl<'e, 's, A, E, ES, SS> PartialEq for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + PartialEq,
E: AggregateEvent<A> + PartialEq,
ES: EventSource<A, E> + 'e + PartialEq,
SS: SnapshotSource<A> + 's + PartialEq,
Source§fn eq(&self, other: &CompositeEntitySource<'e, 's, A, E, ES, SS>) -> bool
fn eq(&self, other: &CompositeEntitySource<'e, 's, A, E, ES, SS>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<'e, 's, A, E, ES, SS> SnapshotSource<A> for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> SnapshotSource<A> for CompositeEntitySource<'e, 's, A, E, ES, SS>
Source§type Error = <SS as SnapshotSource<A>>::Error
type Error = <SS as SnapshotSource<A>>::Error
The error type.
Source§fn get_snapshot<I>(
&self,
id: &I,
) -> Result<Option<VersionedAggregate<A>>, <Self as SnapshotSource<A>>::Error>where
I: AggregateId<A>,
fn get_snapshot<I>(
&self,
id: &I,
) -> Result<Option<VersionedAggregate<A>>, <Self as SnapshotSource<A>>::Error>where
I: AggregateId<A>,
Loads a versioned aggregate from the snapshot source.
impl<'e, 's, A, E, ES, SS> Copy for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + Copy,
E: AggregateEvent<A> + Copy,
ES: EventSource<A, E> + 'e + Copy,
SS: SnapshotSource<A> + 's + Copy,
impl<'e, 's, A, E, ES, SS> Eq for CompositeEntitySource<'e, 's, A, E, ES, SS>where
A: Aggregate + Eq,
E: AggregateEvent<A> + Eq,
ES: EventSource<A, E> + 'e + Eq,
SS: SnapshotSource<A> + 's + Eq,
impl<'e, 's, A, E, ES, SS> StructuralPartialEq for CompositeEntitySource<'e, 's, A, E, ES, SS>
Auto Trait Implementations§
impl<'e, 's, A, E, ES, SS> Freeze for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> RefUnwindSafe for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> Send for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> Sync for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> Unpin for CompositeEntitySource<'e, 's, A, E, ES, SS>
impl<'e, 's, A, E, ES, SS> UnwindSafe for CompositeEntitySource<'e, 's, A, E, ES, SS>
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A, E, T> EntitySource<A, E> for T
impl<A, E, T> EntitySource<A, E> for T
Source§fn load_from_snapshot<I>(
&self,
id: &I,
) -> Result<Option<HydratedAggregate<A>>, <Self as SnapshotSource<A>>::Error>where
I: AggregateId<A>,
fn load_from_snapshot<I>(
&self,
id: &I,
) -> Result<Option<HydratedAggregate<A>>, <Self as SnapshotSource<A>>::Error>where
I: AggregateId<A>,
Source§fn refresh<I>(
&self,
id: &I,
aggregate: &mut HydratedAggregate<A>,
) -> Result<(), <Self as EventSource<A, E>>::Error>where
I: AggregateId<A>,
fn refresh<I>(
&self,
id: &I,
aggregate: &mut HydratedAggregate<A>,
) -> Result<(), <Self as EventSource<A, E>>::Error>where
I: AggregateId<A>,
Refreshes an existing hydrated aggregate with the given id. Read more
Source§fn rehydrate<I>(
&self,
id: &I,
) -> Result<Option<HydratedAggregate<A>>, EntityLoadError<<Self as EventSource<A, E>>::Error, <Self as SnapshotSource<A>>::Error>>where
I: AggregateId<A>,
fn rehydrate<I>(
&self,
id: &I,
) -> Result<Option<HydratedAggregate<A>>, EntityLoadError<<Self as EventSource<A, E>>::Error, <Self as SnapshotSource<A>>::Error>>where
I: AggregateId<A>,
Loads an entity from the most recent snapshot of its aggregate, then applies any newer events that have not yet been
applied. Read more