[][src]Trait cqrs::EventSource

pub trait EventSource<A, E> where
    A: Aggregate,
    E: AggregateEvent<A>,
    <Self::Events as IntoIterator>::Item == VersionedEvent<E>, 
{ type Events: IntoIterator; type Error: CqrsError; fn read_events<I>(
        &self,
        id: &I,
        since: Since,
        max_count: Option<u64>
    ) -> Result<Option<Self::Events>, Self::Error>
    where
        I: AggregateId<A>
; }

A source for reading/loading events.

Associated Types

type Events: IntoIterator

Represents the sequence of events read from the event source.

type Error: CqrsError

The error type.

Loading content...

Required methods

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.

Only loads events after the event number provided in since (See Since), and will only load a maximum of max_count events, if given. If not given, will read all remaining events.

Loading content...

Implementors

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, 
[src]

type Error = ES::Error

type Events = ES::Events

impl<A, E> EventSource<A, E> for NullEventStore<A, E> where
    A: Aggregate,
    E: AggregateEvent<A>, 
[src]

type Error = Void

type Events = Empty<VersionedEvent<E>>

impl<A, E, M, ES, SS> EventSource<A, E> for CompositeEntityStore<A, E, M, ES, SS> where
    A: Aggregate,
    E: AggregateEvent<A>,
    ES: EntitySource<A, E>,
    SS: EntitySink<A, E, M>, 
[src]

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

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

impl<A, E, M, Hasher> EventSource<A, E> for EventStore<A, E, M, Hasher> where
    A: Aggregate,
    E: AggregateEvent<A> + Clone,
    Hasher: BuildHasher
[src]

type Error = Void

type Events = Vec<VersionedEvent<E>>

Loading content...