Struct CompositeEntitySource

Source
pub struct CompositeEntitySource<'e, 's, A, E, ES, SS>
where A: Aggregate, E: AggregateEvent<A>, ES: EventSource<A, E> + 'e, SS: SnapshotSource<A> + 's,
{ /* 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>
where A: Aggregate, E: AggregateEvent<A>, ES: EventSource<A, E> + 'e, SS: SnapshotSource<A> + 's,

Source

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.

Source

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,

Source§

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)

Performs copy-assignment from source. Read more
Source§

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§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A, E> Default for CompositeEntitySource<'static, 'static, A, E, NullEventStore<A, E>, NullSnapshotStore<A>>
where A: Aggregate, E: AggregateEvent<A>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'e, 's, A, E, ES, SS> EventSource<A, E> for CompositeEntitySource<'e, 's, A, E, ES, SS>
where A: Aggregate, E: AggregateEvent<A>, ES: EventSource<A, E> + 'e, SS: SnapshotSource<A> + 's,

Source§

type Error = <ES as EventSource<A, E>>::Error

The error type.
Source§

type Events = <ES as EventSource<A, E>>::Events

Represents the sequence of events read from the event source.
Source§

fn read_events<I>( &self, id: &I, since: Since, max_count: Option<u64>, ) -> Result<Option<Self::Events>, Self::Error>
where I: AggregateId<A>,

Reads events from the event source for a given identifier. Read more
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,

Source§

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 ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'e, 's, A, E, ES, SS> SnapshotSource<A> for CompositeEntitySource<'e, 's, A, E, ES, SS>
where A: Aggregate, E: AggregateEvent<A>, ES: EventSource<A, E> + 'e, SS: SnapshotSource<A> + 's,

Source§

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>,

Loads a versioned aggregate from the snapshot source.
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,

Source§

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,

Source§

impl<'e, 's, A, E, ES, SS> StructuralPartialEq for CompositeEntitySource<'e, 's, A, E, ES, SS>
where A: Aggregate, E: AggregateEvent<A>, ES: EventSource<A, E> + 'e, SS: SnapshotSource<A> + 's,

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>
where ES: Sync, SS: Sync, A: Sync, E: Sync,

§

impl<'e, 's, A, E, ES, SS> Sync for CompositeEntitySource<'e, 's, A, E, ES, SS>
where ES: Sync, SS: Sync, A: Sync, E: Sync,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<A, E, T> EntitySource<A, E> for T
where A: Aggregate, E: AggregateEvent<A>, T: EventSource<A, E> + SnapshotSource<A>,

Source§

fn load_from_snapshot<I>( &self, id: &I, ) -> Result<Option<HydratedAggregate<A>>, <Self as SnapshotSource<A>>::Error>
where I: AggregateId<A>,

Loads an identified Entity from the latest known snapshot. Read more
Source§

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>,

Loads an entity from the most recent snapshot of its aggregate, then applies any newer events that have not yet been applied. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.