pub struct ConsumerClient<S = DefaultGrpcImpl> { /* private fields */ }google only.Expand description
A client through which PubSub consuming operations can be performed.
This includes managing subscriptions and reading data from subscriptions. Created using
build_consumer
Implementations§
Source§impl<S> ConsumerClient<S>
impl<S> ConsumerClient<S>
Sourcepub fn from_client(
client: SubscriberClient<S>,
project: String,
queue: String,
) -> Self
pub fn from_client( client: SubscriberClient<S>, project: String, queue: String, ) -> Self
Create a new consumer from an existing pubsub client.
This function is useful for client customization; most callers should typically use the
defaults provided by build_consumer
Sourcepub fn format_subscription(
&self,
subscription: SubscriptionName<'_>,
) -> ProjectSubscriptionName
pub fn format_subscription( &self, subscription: SubscriptionName<'_>, ) -> ProjectSubscriptionName
Construct a fully formatted project and subscription name for the given subscription
Sourcepub fn format_topic(&self, topic: TopicName<'_>) -> ProjectTopicName
pub fn format_topic(&self, topic: TopicName<'_>) -> ProjectTopicName
Construct a fully formatted project and topic name for the given topic
Sourcepub fn inner(&self) -> &SubscriberClient<S>
pub fn inner(&self) -> &SubscriberClient<S>
Get a reference to the underlying pubsub client
Sourcepub fn inner_mut(&mut self) -> &mut SubscriberClient<S>
pub fn inner_mut(&mut self) -> &mut SubscriberClient<S>
Get a mutable reference to the underlying pubsub client
Source§impl<S> ConsumerClient<S>where
S: GrpcService<BoxBody>,
S::Error: Into<StdError>,
S::ResponseBody: Body<Data = Bytes> + Send + 'static,
<S::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<S> ConsumerClient<S>where
S: GrpcService<BoxBody>,
S::Error: Into<StdError>,
S::ResponseBody: Body<Data = Bytes> + Send + 'static,
<S::ResponseBody as Body>::Error: Into<StdError> + Send,
Sourcepub async fn create_subscription(
&mut self,
config: SubscriptionConfig<'_>,
) -> Result<(), PubSubError>
pub async fn create_subscription( &mut self, config: SubscriptionConfig<'_>, ) -> Result<(), PubSubError>
Create a new PubSub subscription
See the GCP documentation on subscriptions here
Sourcepub async fn delete_subscription(
&mut self,
subscription: SubscriptionName<'_>,
) -> Result<(), PubSubError>
pub async fn delete_subscription( &mut self, subscription: SubscriptionName<'_>, ) -> Result<(), PubSubError>
Delete an existing PubSub subscription.
See the GCP documentation on subscriptions here
Sourcepub fn stream_subscription(
&mut self,
subscription: SubscriptionName<'_>,
stream_config: StreamSubscriptionConfig,
) -> PubSubStream<S>where
S: Clone,
pub fn stream_subscription(
&mut self,
subscription: SubscriptionName<'_>,
stream_config: StreamSubscriptionConfig,
) -> PubSubStream<S>where
S: Clone,
Connect to PubSub and start streaming messages from the given subscription
Sourcepub async fn seek(
&mut self,
subscription: SubscriptionName<'_>,
timestamp: Timestamp,
) -> Result<(), PubSubError>
pub async fn seek( &mut self, subscription: SubscriptionName<'_>, timestamp: Timestamp, ) -> Result<(), PubSubError>
Seeks messages from the given timestamp. It marks as acknowledged all the messages prior to the timestamp, and as not acknowledged the messages after the timestamp.
Trait Implementations§
Source§impl<S: Clone> Clone for ConsumerClient<S>
impl<S: Clone> Clone for ConsumerClient<S>
Source§fn clone(&self) -> ConsumerClient<S>
fn clone(&self) -> ConsumerClient<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<S = AuthGrpcService<Channel>> !Freeze for ConsumerClient<S>
impl<S> RefUnwindSafe for ConsumerClient<S>where
S: RefUnwindSafe,
impl<S> Send for ConsumerClient<S>where
S: Send,
impl<S> Sync for ConsumerClient<S>where
S: Sync,
impl<S> Unpin for ConsumerClient<S>where
S: Unpin,
impl<S> UnsafeUnpin for ConsumerClient<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ConsumerClient<S>where
S: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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