SubscriberClient

Struct SubscriberClient 

Source
pub struct SubscriberClient { /* private fields */ }

Implementations§

Source§

impl SubscriberClient

Source

pub fn new( cm: ConnectionManager, streaming_pull_cm: ConnectionManager, ) -> SubscriberClient

create new Subscriber client

Source

pub async fn create_subscription( &self, req: Subscription, retry: Option<RetrySetting>, ) -> Result<Response<Subscription>, Status>

create_subscription creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/admin#resource_names (at https://cloud.google.com/pubsub/docs/admin#resource_names)). If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn’t exist, returns NOT_FOUND.

If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names (at https://cloud.google.com/pubsub/docs/admin#resource_names)). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

Source

pub async fn update_subscription( &self, req: UpdateSubscriptionRequest, retry: Option<RetrySetting>, ) -> Result<Response<Subscription>, Status>

updateSubscription updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.

Source

pub async fn get_subscription( &self, req: GetSubscriptionRequest, retry: Option<RetrySetting>, ) -> Result<Response<Subscription>, Status>

get_subscription gets the configuration details of a subscription.

Source

pub async fn list_subscriptions( &self, req: ListSubscriptionsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Subscription>, Status>

list_subscriptions lists matching subscriptions.

Source

pub async fn delete_subscription( &self, req: DeleteSubscriptionRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>

delete_subscription deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

Source

pub async fn modify_ack_deadline( &self, req: ModifyAckDeadlineRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>

ModifyAckDeadline modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level ackDeadlineSeconds used for subsequent messages.

Source

pub async fn acknowledge( &self, req: AcknowledgeRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>

acknowledge acknowledges the messages associated with the ack_ids in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription.

Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.

Source

pub async fn pull( &self, req: PullRequest, retry: Option<RetrySetting>, ) -> Result<Response<PullResponse>, Status>

pull pulls messages from the server. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.

Source

pub async fn streaming_pull( &self, req: StreamingPullRequest, ping_receiver: Receiver<bool>, retry: Option<RetrySetting>, ) -> Result<Response<Streaming<StreamingPullResponse>>, Status>

streaming_pull establishes a stream with the server, which sends messages down to the client. The client streams acknowledgements and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status UNAVAILABLE to reassign server-side resources, in which case, the client should re-establish the stream. Flow control can be achieved by configuring the underlying RPC channel.

Source

pub async fn modify_push_config( &self, req: ModifyPushConfigRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>

modify_push_config modifies the PushConfig for a specified subscription.

This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.

Source

pub async fn get_snapshot( &self, req: GetSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<Snapshot>, Status>

get_snapshot gets the configuration details of a snapshot. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) 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

Source

pub async fn list_snapshots( &self, req: ListSnapshotsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Snapshot>, Status>

list_snapshots lists the existing snapshots. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) 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.

Source

pub async fn create_snapshot( &self, req: CreateSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<Snapshot>, Status>

create_snapshot creates a snapshot from the requested subscription. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) 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. If the snapshot already exists, returns ALREADY_EXISTS. If the requested subscription doesn’t exist, returns NOT_FOUND. If the backlog in the subscription is too old – and the resulting snapshot would expire in less than 1 hour – then FAILED_PRECONDITION is returned. See also the Snapshot.expire_time field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names (at https://cloud.google.com/pubsub/docs/admin#resource_names)). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

Source

pub async fn update_snapshot( &self, req: UpdateSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<Snapshot>, Status>

update_snapshot updates an existing snapshot. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) 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.

Source

pub async fn delete_snapshot( &self, req: DeleteSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>

delete_snapshot removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview (at https://cloud.google.com/pubsub/docs/replay-overview)) 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. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

Source

pub async fn seek( &self, req: SeekRequest, retry: Option<RetrySetting>, ) -> Result<Response<SeekResponse>, Status>

Trait Implementations§

Source§

impl Clone for SubscriberClient

Source§

fn clone(&self) -> SubscriberClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubscriberClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,