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 as GrpcService<BoxBody>>::ResponseBody: Body + Body + Send + 'static,
<T as GrpcService<BoxBody>>::Error: Into<Box<dyn Error + Sync + Send>>,
<<T as GrpcService<BoxBody>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,
impl<T> PublisherClient<T>where
T: GrpcService<BoxBody>,
<T as GrpcService<BoxBody>>::ResponseBody: Body + Body + Send + 'static,
<T as GrpcService<BoxBody>>::Error: Into<Box<dyn Error + Sync + Send>>,
<<T as GrpcService<BoxBody>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,
pub fn new(inner: T) -> PublisherClient<T>
pub fn with_interceptor( inner: T, interceptor: impl Into<Interceptor>, ) -> PublisherClient<T>
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/admin#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. 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 for PublisherClient<T>where
T: Clone,
impl<T> Clone for PublisherClient<T>where
T: Clone,
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>where
T: Freeze,
impl<T> !RefUnwindSafe for PublisherClient<T>
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>
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> 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