pub struct EventStoreClient<T> { /* private fields */ }
Expand description
Service providing operations against the EventStore functionality of Axon Server
Implementations§
source§impl<T> EventStoreClient<T>where
T: GrpcService<UnsyncBoxBody<Bytes, Status>>,
<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::Error: Into<Box<dyn Error + Sync + Send>>,
<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::ResponseBody: Body<Data = Bytes> + Send + 'static,
<<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,
impl<T> EventStoreClient<T>where
T: GrpcService<UnsyncBoxBody<Bytes, Status>>,
<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::Error: Into<Box<dyn Error + Sync + Send>>,
<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::ResponseBody: Body<Data = Bytes> + Send + 'static,
<<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,
pub fn new(inner: T) -> EventStoreClient<T>
pub fn with_origin(inner: T, origin: Uri) -> EventStoreClient<T>
pub fn with_interceptor<F>(
inner: T,
interceptor: F
) -> EventStoreClient<InterceptedService<T, F>>where
F: Interceptor,
<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::ResponseBody: Default,
T: Service<Request<UnsyncBoxBody<Bytes, Status>>, Response = Response<<T as GrpcService<UnsyncBoxBody<Bytes, Status>>>::ResponseBody>>,
<T as Service<Request<UnsyncBoxBody<Bytes, Status>>>>::Error: Into<Box<dyn Error + Sync + Send>> + Send + Sync,
sourcepub fn send_compressed(
self,
encoding: CompressionEncoding
) -> EventStoreClient<T>
pub fn send_compressed( self, encoding: CompressionEncoding ) -> EventStoreClient<T>
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(
self,
encoding: CompressionEncoding
) -> EventStoreClient<T>
pub fn accept_compressed( self, encoding: CompressionEncoding ) -> EventStoreClient<T>
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> EventStoreClient<T>
pub fn max_decoding_message_size(self, limit: usize) -> EventStoreClient<T>
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> EventStoreClient<T>
pub fn max_encoding_message_size(self, limit: usize) -> EventStoreClient<T>
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn append_event(
&mut self,
request: impl IntoStreamingRequest<Message = Event>
) -> Result<Response<Confirmation>, Status>
pub async fn append_event( &mut self, request: impl IntoStreamingRequest<Message = Event> ) -> Result<Response<Confirmation>, Status>
Accepts a stream of Events returning a Confirmation when completed.
sourcepub async fn append_snapshot(
&mut self,
request: impl IntoRequest<Event>
) -> Result<Response<Confirmation>, Status>
pub async fn append_snapshot( &mut self, request: impl IntoRequest<Event> ) -> Result<Response<Confirmation>, Status>
Accepts a Snapshot event returning a Confirmation when completed.
sourcepub async fn list_aggregate_events(
&mut self,
request: impl IntoRequest<GetAggregateEventsRequest>
) -> Result<Response<Streaming<Event>>, Status>
pub async fn list_aggregate_events( &mut self, request: impl IntoRequest<GetAggregateEventsRequest> ) -> Result<Response<Streaming<Event>>, Status>
Retrieves the Events for a given aggregate. Results are streamed rather than returned at once.
sourcepub async fn list_aggregate_snapshots(
&mut self,
request: impl IntoRequest<GetAggregateSnapshotsRequest>
) -> Result<Response<Streaming<Event>>, Status>
pub async fn list_aggregate_snapshots( &mut self, request: impl IntoRequest<GetAggregateSnapshotsRequest> ) -> Result<Response<Streaming<Event>>, Status>
Retrieves the Snapshots for a given aggregate. Results are streamed rather than returned at once.
sourcepub async fn list_events(
&mut self,
request: impl IntoStreamingRequest<Message = GetEventsRequest>
) -> Result<Response<Streaming<EventWithToken>>, Status>
pub async fn list_events( &mut self, request: impl IntoStreamingRequest<Message = GetEventsRequest> ) -> Result<Response<Streaming<EventWithToken>>, Status>
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.
sourcepub async fn read_highest_sequence_nr(
&mut self,
request: impl IntoRequest<ReadHighestSequenceNrRequest>
) -> Result<Response<ReadHighestSequenceNrResponse>, Status>
pub async fn read_highest_sequence_nr( &mut self, request: impl IntoRequest<ReadHighestSequenceNrRequest> ) -> Result<Response<ReadHighestSequenceNrResponse>, Status>
Gets the highest sequence number for a specific aggregate.
sourcepub async fn query_events(
&mut self,
request: impl IntoStreamingRequest<Message = QueryEventsRequest>
) -> Result<Response<Streaming<QueryEventsResponse>>, Status>
pub async fn query_events( &mut self, request: impl IntoStreamingRequest<Message = QueryEventsRequest> ) -> Result<Response<Streaming<QueryEventsResponse>>, Status>
Performs a query on the event store, returns a stream of results. Input is a stream to allow flow control from the client
sourcepub async fn get_first_token(
&mut self,
request: impl IntoRequest<GetFirstTokenRequest>
) -> Result<Response<TrackingToken>, Status>
pub async fn get_first_token( &mut self, request: impl IntoRequest<GetFirstTokenRequest> ) -> Result<Response<TrackingToken>, Status>
Retrieves the first token available in event store (typically 0). Returns 0 when no events in store.
sourcepub async fn get_last_token(
&mut self,
request: impl IntoRequest<GetLastTokenRequest>
) -> Result<Response<TrackingToken>, Status>
pub async fn get_last_token( &mut self, request: impl IntoRequest<GetLastTokenRequest> ) -> Result<Response<TrackingToken>, Status>
Retrieves the last committed token in event store. Returns -1 when no events in store.
sourcepub async fn get_token_at(
&mut self,
request: impl IntoRequest<GetTokenAtRequest>
) -> Result<Response<TrackingToken>, Status>
pub async fn get_token_at( &mut self, request: impl IntoRequest<GetTokenAtRequest> ) -> Result<Response<TrackingToken>, Status>
Retrieves the token of the first token of an event from specified time in event store. Returns -1 when no events in store.
Trait Implementations§
source§impl<T> Clone for EventStoreClient<T>where
T: Clone,
impl<T> Clone for EventStoreClient<T>where
T: Clone,
source§fn clone(&self) -> EventStoreClient<T>
fn clone(&self) -> EventStoreClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for EventStoreClient<T>where
T: RefUnwindSafe,
impl<T> Send for EventStoreClient<T>where
T: Send,
impl<T> Sync for EventStoreClient<T>where
T: Sync,
impl<T> Unpin for EventStoreClient<T>where
T: Unpin,
impl<T> UnwindSafe for EventStoreClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request