pub struct TopicServiceClient<T> { /* private fields */ }
Implementations§
Source§impl<T> TopicServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> TopicServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TopicServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
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) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub async fn stream_write(
&mut self,
request: impl IntoStreamingRequest<Message = FromClient>,
) -> Result<Response<Streaming<FromServer>>, Status>
pub async fn stream_write( &mut self, request: impl IntoStreamingRequest<Message = FromClient>, ) -> Result<Response<Streaming<FromServer>>, Status>
Create Write Session Pipeline example: client server InitRequest(Topic, MessageGroupID, …) ––––––––> InitResponse(Partition, MaxSeqNo, …) <–––––––– WriteRequest(data1, seqNo1) ––––––––> WriteRequest(data2, seqNo2) ––––––––> WriteResponse(seqNo1, offset1, …) <–––––––– WriteRequest(data3, seqNo3) ––––––––> WriteResponse(seqNo2, offset2, …) <–––––––– [something went wrong] (status != SUCCESS, issues not empty) <––––––––
Sourcepub async fn stream_read(
&mut self,
request: impl IntoStreamingRequest<Message = FromClient>,
) -> Result<Response<Streaming<FromServer>>, Status>
pub async fn stream_read( &mut self, request: impl IntoStreamingRequest<Message = FromClient>, ) -> Result<Response<Streaming<FromServer>>, Status>
Create Read Session Pipeline: client server InitRequest(Topics, ClientId, …) ––––––––> InitResponse(SessionId) <–––––––– ReadRequest ––––––––> ReadRequest ––––––––> StartPartitionSessionRequest(Topic1, Partition1, PartitionSessionID1, …) <–––––––– StartPartitionSessionRequest(Topic2, Partition2, PartitionSessionID2, …) <–––––––– StartPartitionSessionResponse(PartitionSessionID1, …) client must respond with this message to actually start recieving data messages from this partition ––––––––> StopPartitionSessionRequest(PartitionSessionID1, …) <–––––––– StopPartitionSessionResponse(PartitionSessionID1, …) only after this response server will give this parittion to other session. ––––––––> StartPartitionSessionResponse(PartitionSession2, …) ––––––––> ReadResponse(data, …) <–––––––– CommitRequest(PartitionCommit1, …) ––––––––> CommitResponse(PartitionCommitAck1, …) <–––––––– [something went wrong] (status != SUCCESS, issues not empty) <––––––––
Sourcepub async fn commit_offset(
&mut self,
request: impl IntoRequest<CommitOffsetRequest>,
) -> Result<Response<CommitOffsetResponse>, Status>
pub async fn commit_offset( &mut self, request: impl IntoRequest<CommitOffsetRequest>, ) -> Result<Response<CommitOffsetResponse>, Status>
Single commit offset request.
Sourcepub async fn update_offsets_in_transaction(
&mut self,
request: impl IntoRequest<UpdateOffsetsInTransactionRequest>,
) -> Result<Response<UpdateOffsetsInTransactionResponse>, Status>
pub async fn update_offsets_in_transaction( &mut self, request: impl IntoRequest<UpdateOffsetsInTransactionRequest>, ) -> Result<Response<UpdateOffsetsInTransactionResponse>, Status>
Add information about offset ranges to the transaction.
Sourcepub async fn create_topic(
&mut self,
request: impl IntoRequest<CreateTopicRequest>,
) -> Result<Response<CreateTopicResponse>, Status>
pub async fn create_topic( &mut self, request: impl IntoRequest<CreateTopicRequest>, ) -> Result<Response<CreateTopicResponse>, Status>
Create topic command.
Sourcepub async fn describe_topic(
&mut self,
request: impl IntoRequest<DescribeTopicRequest>,
) -> Result<Response<DescribeTopicResponse>, Status>
pub async fn describe_topic( &mut self, request: impl IntoRequest<DescribeTopicRequest>, ) -> Result<Response<DescribeTopicResponse>, Status>
Describe topic command.
Sourcepub async fn describe_consumer(
&mut self,
request: impl IntoRequest<DescribeConsumerRequest>,
) -> Result<Response<DescribeConsumerResponse>, Status>
pub async fn describe_consumer( &mut self, request: impl IntoRequest<DescribeConsumerRequest>, ) -> Result<Response<DescribeConsumerResponse>, Status>
Describe topic’s consumer command.
Sourcepub async fn alter_topic(
&mut self,
request: impl IntoRequest<AlterTopicRequest>,
) -> Result<Response<AlterTopicResponse>, Status>
pub async fn alter_topic( &mut self, request: impl IntoRequest<AlterTopicRequest>, ) -> Result<Response<AlterTopicResponse>, Status>
Alter topic command.
Sourcepub async fn drop_topic(
&mut self,
request: impl IntoRequest<DropTopicRequest>,
) -> Result<Response<DropTopicResponse>, Status>
pub async fn drop_topic( &mut self, request: impl IntoRequest<DropTopicRequest>, ) -> Result<Response<DropTopicResponse>, Status>
Drop topic command.
Trait Implementations§
Source§impl<T: Clone> Clone for TopicServiceClient<T>
impl<T: Clone> Clone for TopicServiceClient<T>
Source§fn clone(&self) -> TopicServiceClient<T>
fn clone(&self) -> TopicServiceClient<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> !Freeze for TopicServiceClient<T>
impl<T> RefUnwindSafe for TopicServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for TopicServiceClient<T>where
T: Send,
impl<T> Sync for TopicServiceClient<T>where
T: Sync,
impl<T> Unpin for TopicServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for TopicServiceClient<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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::Request