pub struct SqsMessage { /* private fields */ }Expand description
A message delivered by an SqsSubscriber.
ack deletes the message; nack(requeue = true) zeroes its visibility so it redelivers
immediately; nack_after(delay) sets the visibility to the delay, so deferred retry is
native. nack(requeue = false) deletes: SQS has no drop verb short of deletion - poison
routing belongs to the queue’s redrive policy, driven by repeated requeues.
While the handle is alive, a background task keeps extending the message’s visibility, so a handler outliving the visibility timeout does not cause a concurrent redelivery.
Trait Implementations§
Source§impl Debug for SqsMessage
impl Debug for SqsMessage
Source§impl Drop for SqsMessage
impl Drop for SqsMessage
Source§impl IncomingMessage for SqsMessage
impl IncomingMessage for SqsMessage
Source§fn supports_nack_after(&self) -> bool
fn supports_nack_after(&self) -> bool
Every SQS delivery honors a delayed redelivery: the visibility timeout is the delay, so
the runtime must take nack_after here instead of its broker-agnostic deferred
re-publish, which would re-publish a copy and reset the receive count.
Source§async fn ack(self) -> Result<(), AckError>
async fn ack(self) -> Result<(), AckError>
Source§async fn nack(self, requeue: bool) -> Result<(), AckError>
async fn nack(self, requeue: bool) -> Result<(), AckError>
requeue is true the broker should
redeliver according to its own retry policy; when false it should drop or dead-letter
the message. Read moreSource§impl Partitioned for SqsMessage
impl Partitioned for SqsMessage
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
None if the broker should pick a partition.Auto Trait Implementations§
impl !Freeze for SqsMessage
impl !RefUnwindSafe for SqsMessage
impl !UnwindSafe for SqsMessage
impl Send for SqsMessage
impl Sync for SqsMessage
impl Unpin for SqsMessage
impl UnsafeUnpin for SqsMessage
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> 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 more