pub trait Subscription {
type SourceId: Eq;
type Event;
type Error;
// Required methods
fn resume(
&self,
) -> BoxFuture<'_, Result<SubscriptionStream<'_, Self>, Self::Error>>;
fn checkpoint(&self, version: u32) -> BoxFuture<'_, Result<(), Self::Error>>;
}Expand description
A Subscription to an EventStream which can be “checkpointed”:
keeps a record of the latest message processed by itself using checkpoint,
and can resume working from such message by using the resume.
Required Associated Types§
Sourcetype SourceId: Eq
type SourceId: Eq
Type of the Source id, typically an AggregateId.
Sourcetype Event
type Event
Event type stored in the EventStore, typically an Aggregate::Event.
Required Methods§
Sourcefn resume(
&self,
) -> BoxFuture<'_, Result<SubscriptionStream<'_, Self>, Self::Error>>
fn resume( &self, ) -> BoxFuture<'_, Result<SubscriptionStream<'_, Self>, Self::Error>>
Resumes the current state of a Subscription by returning the EventStream,
starting from the last event processed by the Subscription.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".