pub struct ExactlyOnce { /* private fields */ }Expand description
A handler for exactly-once delivery.
Implementations§
Source§impl ExactlyOnce
impl ExactlyOnce
Sourcepub async fn confirmed_ack(self) -> Result<(), AckError>
pub async fn confirmed_ack(self) -> Result<(), AckError>
Strongly acknowledge the message associated with this handler.
use google_cloud_pubsub::model::Message;
async fn on_message(m: Message, h: ExactlyOnce) {
match h.confirmed_ack().await {
Ok(()) => println!("Confirmed ack for message={m:?}. The message will not be redelivered."),
Err(e) => println!("Failed to confirm ack for message={m:?} with error={e:?}"),
}
}If the result is an Ok, the message is guaranteed not to be delivered
again.
If the result is an Err, the message may be redelivered, but this is
not guaranteed. If no redelivery occurs a sufficient interval after an
error, the acknowledgement likely succeeded.
Trait Implementations§
Source§impl Debug for ExactlyOnce
impl Debug for ExactlyOnce
Auto Trait Implementations§
impl Freeze for ExactlyOnce
impl !RefUnwindSafe for ExactlyOnce
impl Send for ExactlyOnce
impl Sync for ExactlyOnce
impl Unpin for ExactlyOnce
impl UnsafeUnpin for ExactlyOnce
impl !UnwindSafe for ExactlyOnce
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request