pub struct TopicAdmin { /* private fields */ }Expand description
Implements a client for the Cloud Pub/Sub API.
§Example
let client = TopicAdmin::builder().build().await?;
// use `client` to make requests to the Cloud Pub/Sub API.§Service Description
The service that an application uses to manipulate topics.
§Configuration
To configure TopicAdmin use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://pubsub.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
TopicAdmin holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap TopicAdmin in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl TopicAdmin
impl TopicAdmin
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for TopicAdmin.
let client = TopicAdmin::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: TopicAdmin + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: TopicAdmin + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_topic(&self) -> CreateTopic
pub fn create_topic(&self) -> CreateTopic
Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
Sourcepub fn update_topic(&self) -> UpdateTopic
pub fn update_topic(&self) -> UpdateTopic
Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.
Sourcepub fn list_topics(&self) -> ListTopics
pub fn list_topics(&self) -> ListTopics
Lists matching topics.
Sourcepub fn list_topic_subscriptions(&self) -> ListTopicSubscriptions
pub fn list_topic_subscriptions(&self) -> ListTopicSubscriptions
Lists the names of the attached subscriptions on this topic.
Sourcepub fn list_topic_snapshots(&self) -> ListTopicSnapshots
pub fn list_topic_snapshots(&self) -> ListTopicSnapshots
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 fn delete_topic(&self) -> DeleteTopic
pub fn delete_topic(&self) -> DeleteTopic
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 fn detach_subscription(&self) -> DetachSubscription
pub fn detach_subscription(&self) -> DetachSubscription
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 Clone for TopicAdmin
impl Clone for TopicAdmin
Source§fn clone(&self) -> TopicAdmin
fn clone(&self) -> TopicAdmin
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TopicAdmin
impl !RefUnwindSafe for TopicAdmin
impl Send for TopicAdmin
impl Sync for TopicAdmin
impl Unpin for TopicAdmin
impl !UnwindSafe for TopicAdmin
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