pub struct UpdateServiceClient<T> { /* private fields */ }Expand description
Allows clients to read updates (transactions, (un)assignments, topology events) from the ledger.
GetUpdates provides a comprehensive stream of updates/changes
which happened on the virtual shared ledger. These streams are indexed with ledger
offsets, which are strictly increasing.
The virtual shared ledger consist of changes happening on multiple synchronizers which are
connected to the serving participant. Each update belongs to one synchronizer, this is
provided in the result (the synchronizer_id field in Transaction
for transactions, the source field in UnassignedEvent and the target field in AssignedEvent).
Consumers can rely on strong causal guarantees on the virtual shared ledger for a single
synchronizer: updates which have greater offsets are happened after than updates with smaller
offsets for the same synchronizer. Across different synchronizers this is not guaranteed.
Implementations§
Source§impl<T> UpdateServiceClient<T>where
T: GrpcService<Body>,
<T as GrpcService<Body>>::Error: Into<Box<dyn Error + Sync + Send>>,
<T as GrpcService<Body>>::ResponseBody: Body<Data = Bytes> + Send + 'static,
<<T as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,
impl<T> UpdateServiceClient<T>where
T: GrpcService<Body>,
<T as GrpcService<Body>>::Error: Into<Box<dyn Error + Sync + Send>>,
<T as GrpcService<Body>>::ResponseBody: Body<Data = Bytes> + Send + 'static,
<<T as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,
pub fn new(inner: T) -> UpdateServiceClient<T>
pub fn with_origin(inner: T, origin: Uri) -> UpdateServiceClient<T>
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> UpdateServiceClient<InterceptedService<T, F>>where
F: Interceptor,
<T as GrpcService<Body>>::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<Box<dyn Error + Sync + Send>> + Send + Sync,
Sourcepub fn send_compressed(
self,
encoding: CompressionEncoding,
) -> UpdateServiceClient<T>
pub fn send_compressed( self, encoding: CompressionEncoding, ) -> UpdateServiceClient<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,
) -> UpdateServiceClient<T>
pub fn accept_compressed( self, encoding: CompressionEncoding, ) -> UpdateServiceClient<T>
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> UpdateServiceClient<T>
pub fn max_decoding_message_size(self, limit: usize) -> UpdateServiceClient<T>
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> UpdateServiceClient<T>
pub fn max_encoding_message_size(self, limit: usize) -> UpdateServiceClient<T>
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn get_updates(
&mut self,
request: impl IntoRequest<GetUpdatesRequest>,
) -> Result<Response<Streaming<GetUpdatesResponse>>, Status>
pub async fn get_updates( &mut self, request: impl IntoRequest<GetUpdatesRequest>, ) -> Result<Response<Streaming<GetUpdatesResponse>>, Status>
Read the ledger’s filtered update stream for the specified contents and filters. It returns the event types in accordance with the stream contents selected. Also the selection criteria for individual events depends on the transaction shape chosen.
- ACS delta: a requesting party must be a stakeholder of an event for it to be included.
- ledger effects: a requesting party must be a witness of an event for it to be included.
Sourcepub async fn get_update_by_offset(
&mut self,
request: impl IntoRequest<GetUpdateByOffsetRequest>,
) -> Result<Response<GetUpdateResponse>, Status>
pub async fn get_update_by_offset( &mut self, request: impl IntoRequest<GetUpdateByOffsetRequest>, ) -> Result<Response<GetUpdateResponse>, Status>
Lookup an update by its offset. If there is no update with this offset, or all the events are filtered, an UPDATE_NOT_FOUND error will be raised.
Sourcepub async fn get_update_by_id(
&mut self,
request: impl IntoRequest<GetUpdateByIdRequest>,
) -> Result<Response<GetUpdateResponse>, Status>
pub async fn get_update_by_id( &mut self, request: impl IntoRequest<GetUpdateByIdRequest>, ) -> Result<Response<GetUpdateResponse>, Status>
Lookup an update by its ID. If there is no update with this ID, or all the events are filtered, an UPDATE_NOT_FOUND error will be raised.
Sourcepub async fn get_update_by_hash(
&mut self,
request: impl IntoRequest<GetUpdateByHashRequest>,
) -> Result<Response<GetUpdateResponse>, Status>
pub async fn get_update_by_hash( &mut self, request: impl IntoRequest<GetUpdateByHashRequest>, ) -> Result<Response<GetUpdateResponse>, Status>
Look up an update by its transaction hash. This is only available for updates received after upgrading to Canton version 3.6. If there is no update with this transaction hash, or all the events are filtered, or the update was populated before upgrading to Canton version 3.6, an UPDATE_NOT_FOUND error will be raised.
Sourcepub async fn get_updates_page(
&mut self,
request: impl IntoRequest<GetUpdatesPageRequest>,
) -> Result<Response<GetUpdatesPageResponse>, Status>
pub async fn get_updates_page( &mut self, request: impl IntoRequest<GetUpdatesPageRequest>, ) -> Result<Response<GetUpdatesPageResponse>, Status>
Read a page of ledger’s filtered updates. It returns the event types in accordance with the specified contents and filters. Additionally, the selection criteria for individual events depends on the transaction shape chosen.
- ACS delta: an event is included only if the requesting party is a stakeholder.
- ledger effects: an event is included if the requesting party is a witness.
Trait Implementations§
Source§impl<T> Clone for UpdateServiceClient<T>where
T: Clone,
impl<T> Clone for UpdateServiceClient<T>where
T: Clone,
Source§fn clone(&self) -> UpdateServiceClient<T>
fn clone(&self) -> UpdateServiceClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for UpdateServiceClient<T>
impl<T> RefUnwindSafe for UpdateServiceClient<T>where
Grpc<T>: RefUnwindSafe,
impl<T> Send for UpdateServiceClient<T>
impl<T> Sync for UpdateServiceClient<T>
impl<T> Unpin for UpdateServiceClient<T>
impl<T> UnsafeUnpin for UpdateServiceClient<T>where
Grpc<T>: UnsafeUnpin,
impl<T> UnwindSafe for UpdateServiceClient<T>where
Grpc<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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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::RequestSource§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