Trait dendrite_auth::dendrite::axon_server::event::event_store_server::EventStore
source · pub trait EventStore: Send + Sync + 'static {
type ListAggregateEventsStream: Stream<Item = Result<Event, Status>> + Send + 'static;
type ListAggregateSnapshotsStream: Stream<Item = Result<Event, Status>> + Send + 'static;
type ListEventsStream: Stream<Item = Result<EventWithToken, Status>> + Send + 'static;
type QueryEventsStream: Stream<Item = Result<QueryEventsResponse, Status>> + Send + 'static;
// Required methods
fn append_event<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<Event>>
) -> Pin<Box<dyn Future<Output = Result<Response<Confirmation>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn append_snapshot<'life0, 'async_trait>(
&'life0 self,
request: Request<Event>
) -> Pin<Box<dyn Future<Output = Result<Response<Confirmation>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn list_aggregate_events<'life0, 'async_trait>(
&'life0 self,
request: Request<GetAggregateEventsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAggregateEventsStream>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn list_aggregate_snapshots<'life0, 'async_trait>(
&'life0 self,
request: Request<GetAggregateSnapshotsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAggregateSnapshotsStream>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn list_events<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<GetEventsRequest>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListEventsStream>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn read_highest_sequence_nr<'life0, 'async_trait>(
&'life0 self,
request: Request<ReadHighestSequenceNrRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ReadHighestSequenceNrResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn query_events<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<QueryEventsRequest>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::QueryEventsStream>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_first_token<'life0, 'async_trait>(
&'life0 self,
request: Request<GetFirstTokenRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_last_token<'life0, 'async_trait>(
&'life0 self,
request: Request<GetLastTokenRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_token_at<'life0, 'async_trait>(
&'life0 self,
request: Request<GetTokenAtRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Generated trait containing gRPC methods that should be implemented for use with EventStoreServer.
Required Associated Types§
sourcetype ListAggregateEventsStream: Stream<Item = Result<Event, Status>> + Send + 'static
type ListAggregateEventsStream: Stream<Item = Result<Event, Status>> + Send + 'static
Server streaming response type for the ListAggregateEvents method.
sourcetype ListAggregateSnapshotsStream: Stream<Item = Result<Event, Status>> + Send + 'static
type ListAggregateSnapshotsStream: Stream<Item = Result<Event, Status>> + Send + 'static
Server streaming response type for the ListAggregateSnapshots method.
sourcetype ListEventsStream: Stream<Item = Result<EventWithToken, Status>> + Send + 'static
type ListEventsStream: Stream<Item = Result<EventWithToken, Status>> + Send + 'static
Server streaming response type for the ListEvents method.
sourcetype QueryEventsStream: Stream<Item = Result<QueryEventsResponse, Status>> + Send + 'static
type QueryEventsStream: Stream<Item = Result<QueryEventsResponse, Status>> + Send + 'static
Server streaming response type for the QueryEvents method.
Required Methods§
sourcefn append_event<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<Event>>
) -> Pin<Box<dyn Future<Output = Result<Response<Confirmation>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn append_event<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<Event>>
) -> Pin<Box<dyn Future<Output = Result<Response<Confirmation>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Accepts a stream of Events returning a Confirmation when completed.
sourcefn append_snapshot<'life0, 'async_trait>(
&'life0 self,
request: Request<Event>
) -> Pin<Box<dyn Future<Output = Result<Response<Confirmation>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn append_snapshot<'life0, 'async_trait>(
&'life0 self,
request: Request<Event>
) -> Pin<Box<dyn Future<Output = Result<Response<Confirmation>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Accepts a Snapshot event returning a Confirmation when completed.
sourcefn list_aggregate_events<'life0, 'async_trait>(
&'life0 self,
request: Request<GetAggregateEventsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAggregateEventsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_aggregate_events<'life0, 'async_trait>(
&'life0 self,
request: Request<GetAggregateEventsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAggregateEventsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves the Events for a given aggregate. Results are streamed rather than returned at once.
sourcefn list_aggregate_snapshots<'life0, 'async_trait>(
&'life0 self,
request: Request<GetAggregateSnapshotsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAggregateSnapshotsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_aggregate_snapshots<'life0, 'async_trait>(
&'life0 self,
request: Request<GetAggregateSnapshotsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAggregateSnapshotsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves the Snapshots for a given aggregate. Results are streamed rather than returned at once.
sourcefn list_events<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<GetEventsRequest>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListEventsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_events<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<GetEventsRequest>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListEventsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves the Events from a given tracking token. However, if several GetEventsRequests are sent in the stream only first one will create the tracker, others are used for increasing number of permits or blacklisting. Results are streamed rather than returned at once.
sourcefn read_highest_sequence_nr<'life0, 'async_trait>(
&'life0 self,
request: Request<ReadHighestSequenceNrRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ReadHighestSequenceNrResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn read_highest_sequence_nr<'life0, 'async_trait>(
&'life0 self,
request: Request<ReadHighestSequenceNrRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ReadHighestSequenceNrResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the highest sequence number for a specific aggregate.
sourcefn query_events<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<QueryEventsRequest>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::QueryEventsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn query_events<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<QueryEventsRequest>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::QueryEventsStream>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Performs a query on the event store, returns a stream of results. Input is a stream to allow flow control from the client
sourcefn get_first_token<'life0, 'async_trait>(
&'life0 self,
request: Request<GetFirstTokenRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_first_token<'life0, 'async_trait>(
&'life0 self,
request: Request<GetFirstTokenRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves the first token available in event store (typically 0). Returns 0 when no events in store.
sourcefn get_last_token<'life0, 'async_trait>(
&'life0 self,
request: Request<GetLastTokenRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_last_token<'life0, 'async_trait>(
&'life0 self,
request: Request<GetLastTokenRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves the last committed token in event store. Returns -1 when no events in store.
sourcefn get_token_at<'life0, 'async_trait>(
&'life0 self,
request: Request<GetTokenAtRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_token_at<'life0, 'async_trait>(
&'life0 self,
request: Request<GetTokenAtRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<TrackingToken>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves the token of the first token of an event from specified time in event store. Returns -1 when no events in store.