[][src]Trait cqrs_core::EventSource

pub trait EventSource<A, E> where
    A: Aggregate,
    E: AggregateEvent<A>, 
{ type Events: IntoIterator<Item = VersionedEvent<E>>; 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<Item = VersionedEvent<E>>

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

Loading content...