#[non_exhaustive]pub struct IncomingMessage<T> {
pub topic: Arc<TopicMatch>,
pub meta: Arc<MessageMeta>,
pub payload: T,
}Expand description
A successfully delivered message: its decoded payload plus the context that
arrived with it. topic and meta are shared (Arc) across every
subscriber of the same publish; payload is this subscriber’s own decoded
value.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.topic: Arc<TopicMatch>The concrete topic the message arrived on (wildcards resolved).
meta: Arc<MessageMeta>Per-message protocol metadata (QoS, retain, dup, …).
payload: TThe decoded payload.
Implementations§
Source§impl<T> IncomingMessage<T>
impl<T> IncomingMessage<T>
Sourcepub fn new(
topic: Arc<TopicMatch>,
meta: Arc<MessageMeta>,
payload: T,
) -> IncomingMessage<T>
pub fn new( topic: Arc<TopicMatch>, meta: Arc<MessageMeta>, payload: T, ) -> IncomingMessage<T>
Construct an incoming message. The library builds these on the receive
path; it is public so downstream tests can construct one (the type is
#[non_exhaustive], so a struct literal is not available off-crate).
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for IncomingMessage<T>where
T: Freeze,
impl<T> RefUnwindSafe for IncomingMessage<T>where
T: RefUnwindSafe,
impl<T> Send for IncomingMessage<T>where
T: Send,
impl<T> Sync for IncomingMessage<T>where
T: Sync,
impl<T> Unpin for IncomingMessage<T>where
T: Unpin,
impl<T> UnsafeUnpin for IncomingMessage<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for IncomingMessage<T>where
T: UnwindSafe,
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