pub struct AmqpMessage { /* private fields */ }Expand description
A message delivered by an AmqpSubscriber.
ack maps to the accept disposition, nack(requeue = true) to modified with
delivery-failed set (so the broker counts the attempt and redelivers), and
nack(requeue = false) to reject (terminal; the broker’s dead-letter policy applies).
Deliveries received on an at-most-once subscription are already settled, so ack/nack
report AckError::Unsupported instead of pretending.
Trait Implementations§
Source§impl Debug for AmqpMessage
impl Debug for AmqpMessage
Source§impl IncomingMessage for AmqpMessage
impl IncomingMessage for AmqpMessage
Source§fn redelivery_count(&self) -> Option<u64>
fn redelivery_count(&self) -> Option<u64>
The broker’s own count of deliveries of this message, from the delivery-count field of
the AMQP header section, counting this delivery.
A delivery with no header section answers None, which is what a message this crate
published looks like: nothing has counted an attempt for it, and the framework’s
retry-count header carries the attempt instead. That is the answer a deferred retry_after
copy needs, because the copy is a new message to the broker and its delivery-count starts
over while the framework’s header does not.
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§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
None when the
message carries no key. Read moreSource§fn decode_error(&self) -> Option<&CodecError>
fn decode_error(&self) -> Option<&CodecError>
None when it read the delivery
whole. Read moreSource§fn supports_nack_after(&self) -> bool
fn supports_nack_after(&self) -> bool
nack_after natively. Read moreSource§impl Partitioned for AmqpMessage
impl Partitioned for AmqpMessage
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 AmqpMessage
impl RefUnwindSafe for AmqpMessage
impl Send for AmqpMessage
impl Sync for AmqpMessage
impl Unpin for AmqpMessage
impl UnsafeUnpin for AmqpMessage
impl UnwindSafe for AmqpMessage
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