Struct google_api_proto::google::pubsub::v1::publisher_client::PublisherClient
source · pub struct PublisherClient<T> { /* private fields */ }
Expand description
The service that an application uses to manipulate topics, and to send messages to a topic.
Implementations§
source§impl<T> PublisherClient<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> PublisherClient<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,
) -> PublisherClient<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 fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn create_topic(
&mut self,
request: impl IntoRequest<Topic>,
) -> Result<Response<Topic>, Status>
pub async fn create_topic( &mut self, request: impl IntoRequest<Topic>, ) -> Result<Response<Topic>, Status>
Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
sourcepub async fn update_topic(
&mut self,
request: impl IntoRequest<UpdateTopicRequest>,
) -> Result<Response<Topic>, Status>
pub async fn update_topic( &mut self, request: impl IntoRequest<UpdateTopicRequest>, ) -> Result<Response<Topic>, Status>
Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.
sourcepub async fn publish(
&mut self,
request: impl IntoRequest<PublishRequest>,
) -> Result<Response<PublishResponse>, Status>
pub async fn publish( &mut self, request: impl IntoRequest<PublishRequest>, ) -> Result<Response<PublishResponse>, Status>
Adds one or more messages to the topic. Returns NOT_FOUND
if the topic
does not exist.
sourcepub async fn get_topic(
&mut self,
request: impl IntoRequest<GetTopicRequest>,
) -> Result<Response<Topic>, Status>
pub async fn get_topic( &mut self, request: impl IntoRequest<GetTopicRequest>, ) -> Result<Response<Topic>, Status>
Gets the configuration of a topic.
sourcepub async fn list_topics(
&mut self,
request: impl IntoRequest<ListTopicsRequest>,
) -> Result<Response<ListTopicsResponse>, Status>
pub async fn list_topics( &mut self, request: impl IntoRequest<ListTopicsRequest>, ) -> Result<Response<ListTopicsResponse>, Status>
Lists matching topics.
sourcepub async fn list_topic_subscriptions(
&mut self,
request: impl IntoRequest<ListTopicSubscriptionsRequest>,
) -> Result<Response<ListTopicSubscriptionsResponse>, Status>
pub async fn list_topic_subscriptions( &mut self, request: impl IntoRequest<ListTopicSubscriptionsRequest>, ) -> Result<Response<ListTopicSubscriptionsResponse>, Status>
Lists the names of the attached subscriptions on this topic.
sourcepub async fn list_topic_snapshots(
&mut self,
request: impl IntoRequest<ListTopicSnapshotsRequest>,
) -> Result<Response<ListTopicSnapshotsResponse>, Status>
pub async fn list_topic_snapshots( &mut self, request: impl IntoRequest<ListTopicSnapshotsRequest>, ) -> Result<Response<ListTopicSnapshotsResponse>, Status>
Lists the names of the snapshots on this topic. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
sourcepub async fn delete_topic(
&mut self,
request: impl IntoRequest<DeleteTopicRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_topic( &mut self, request: impl IntoRequest<DeleteTopicRequest>, ) -> Result<Response<()>, Status>
Deletes the topic with the given name. Returns NOT_FOUND
if the topic
does not exist. After a topic is deleted, a new topic may be created with
the same name; this is an entirely new topic with none of the old
configuration or subscriptions. Existing subscriptions to this topic are
not deleted, but their topic
field is set to _deleted-topic_
.
sourcepub async fn detach_subscription(
&mut self,
request: impl IntoRequest<DetachSubscriptionRequest>,
) -> Result<Response<DetachSubscriptionResponse>, Status>
pub async fn detach_subscription( &mut self, request: impl IntoRequest<DetachSubscriptionRequest>, ) -> Result<Response<DetachSubscriptionResponse>, Status>
Detaches a subscription from this topic. All messages retained in the
subscription are dropped. Subsequent Pull
and StreamingPull
requests
will return FAILED_PRECONDITION. If the subscription is a push
subscription, pushes to the endpoint will stop.
Trait Implementations§
source§impl<T: Clone> Clone for PublisherClient<T>
impl<T: Clone> Clone for PublisherClient<T>
source§fn clone(&self) -> PublisherClient<T>
fn clone(&self) -> PublisherClient<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 PublisherClient<T>
impl<T> RefUnwindSafe for PublisherClient<T>where
T: RefUnwindSafe,
impl<T> Send for PublisherClient<T>where
T: Send,
impl<T> Sync for PublisherClient<T>where
T: Sync,
impl<T> Unpin for PublisherClient<T>where
T: Unpin,
impl<T> UnwindSafe for PublisherClient<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