pub enum NatsMessage {
Core(Box<CoreMessage>),
JetStream(Box<JetStreamMessage>),
}Expand description
A NATS delivery. Two flavours: core NATS (no ack) and JetStream (real ack/nack/redelivery).
Both variants are boxed to keep the enum compact; the wrapped async_nats messages are large.
Variants§
Core(Box<CoreMessage>)
A core NATS subject delivery. Acknowledgement is not supported.
JetStream(Box<JetStreamMessage>)
A JetStream pull-consumer delivery with full ack support.
Trait Implementations§
Source§impl Debug for NatsMessage
impl Debug for NatsMessage
Source§impl IncomingMessage for NatsMessage
impl IncomingMessage for NatsMessage
Source§async fn ack(self) -> Result<(), AckError>
async fn ack(self) -> Result<(), AckError>
Acknowledges successful processing. Consumes the message handle. Read more
Source§async fn nack(self, requeue: bool) -> Result<(), AckError>
async fn nack(self, requeue: bool) -> Result<(), AckError>
Negatively acknowledges the message. When
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 extensions(&self) -> Extensions
fn extensions(&self) -> Extensions
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
Returns the routing key the broker partitioned this message by, or
None when the
message carries no key. Read moreSource§fn supports_nack_after(&self) -> bool
fn supports_nack_after(&self) -> bool
Reports whether this transport can honor
nack_after natively. Read moreSource§impl Partitioned for NatsMessage
Partitioned lets the workers(N, by_key) runtime feature assign a dispatch lane based on
a well-known message header. NATS has no native partition concept, so the key travels as the
PARTITION_KEY_HEADER header value and the sender is responsible for setting it.
impl Partitioned for NatsMessage
Partitioned lets the workers(N, by_key) runtime feature assign a dispatch lane based on
a well-known message header. NATS has no native partition concept, so the key travels as the
PARTITION_KEY_HEADER header value and the sender is responsible for setting it.
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
Returns the partition key for this item, or
None if the broker should pick a partition.Auto Trait Implementations§
impl !RefUnwindSafe for NatsMessage
impl !UnwindSafe for NatsMessage
impl Freeze for NatsMessage
impl Send for NatsMessage
impl Sync for NatsMessage
impl Unpin for NatsMessage
impl UnsafeUnpin for NatsMessage
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