pub struct MqttMessage { /* private fields */ }Expand description
A message delivered by an MqttSubscriber.
ack acknowledges through the protocol for QoS 1 (PUBACK) and QoS 2 (PUBREC, with the
client completing the handshake); QoS 0 deliveries report
AckError::Unsupported. MQTT has no negative acknowledgement, so nack(requeue = true)
reports AckError::Unsupported as well - unacknowledged messages redeliver when the
session resumes - and nack(requeue = false) acknowledges (dropping is the only terminal
outcome the protocol offers).
A handler’s HandlerOutcome::retry() settles through that refused negative acknowledgement, so
it does not retry inside the live connection: the delivery stays unacknowledged and comes back
only when a persistent session resumes. retry_after with a retry publisher is the outcome
that retries within the session. The site’s
retry and
retry_after
pages show both in a service.
A delivery reports no redelivery count. The protocol carries a duplicate flag and no counter, so a registration’s cap is counted on the framework’s retry-count header instead, which the copies the runtime publishes carry.
Implementations§
Source§impl MqttMessage
impl MqttMessage
Sourcepub fn topic(&self) -> &str
pub fn topic(&self) -> &str
The topic this message was published to (the real topic, never a $share filter).
Sourcepub const fn qos(&self) -> Qos
pub const fn qos(&self) -> Qos
The quality of service this message was delivered at: the lesser of the one it was published with and the one its subscription asked for.
A delivery at Qos::AtMostOnce carries no acknowledgement, so ack reports
AckError::Unsupported for it.
Trait Implementations§
Source§impl BuildContext<MqttMessage> for MqttContext
impl BuildContext<MqttMessage> for MqttContext
Source§fn build(msg: &MqttMessage) -> Self
fn build(msg: &MqttMessage) -> Self
msg.Source§impl Debug for MqttMessage
impl Debug for MqttMessage
Source§impl IncomingMessage for MqttMessage
impl IncomingMessage for MqttMessage
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
The PARTITION_KEY_HEADER value the publisher set, which keyed worker lanes
(workers(n, by_key)) order by.
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 redelivery_count(&self) -> Option<u64>
fn redelivery_count(&self) -> Option<u64>
None
where the transport counts nothing. 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 MqttMessage
The key a delivery is ordered by. MQTT has no partitions, so the key is the
PARTITION_KEY_HEADER the publisher set.
impl Partitioned for MqttMessage
The key a delivery is ordered by. MQTT has no partitions, so the key is the
PARTITION_KEY_HEADER the publisher set.
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 MqttMessage
impl RefUnwindSafe for MqttMessage
impl Send for MqttMessage
impl Sync for MqttMessage
impl Unpin for MqttMessage
impl UnsafeUnpin for MqttMessage
impl UnwindSafe for MqttMessage
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