pub struct RawMessageInfo<'a> { /* private fields */ }Expand description
Raw-subscription message info: MessageInfo metadata plus the
sample’s wire-level attachment bytes, borrowed for the callback
scope.
Surfaced on the generic (type-erased) subscription path
(node.subscription(t).generic(..).message_info().build(cb) — the
FnMut(&[u8], &RawMessageInfo) callback). The attachment carries
out-of-band tags such as the cross-RMW bridge’s bridge_origin
(read via attachment for echo suppression).
The 'a lifetime ties the borrowed attachment to the dispatch call;
copy out what you need before the callback returns. Metadata
accessors delegate to the inner MessageInfo; on backends without
a combined raw+info+attachment take they read their defaults (the
attachment is always populated).
Implementations§
Source§impl<'a> RawMessageInfo<'a>
impl<'a> RawMessageInfo<'a>
Sourcepub const fn new(attachment: &'a [u8]) -> RawMessageInfo<'a>
pub const fn new(attachment: &'a [u8]) -> RawMessageInfo<'a>
Build from an attachment slice (metadata defaulted).
Sourcepub const fn with_info(
info: MessageInfo,
attachment: &'a [u8],
) -> RawMessageInfo<'a>
pub const fn with_info( info: MessageInfo, attachment: &'a [u8], ) -> RawMessageInfo<'a>
Build from explicit metadata + attachment.
Sourcepub const fn attachment(&self) -> &'a [u8] ⓘ
pub const fn attachment(&self) -> &'a [u8] ⓘ
The sample’s wire-level attachment bytes (empty if none).
Sourcepub const fn info(&self) -> &MessageInfo
pub const fn info(&self) -> &MessageInfo
The underlying metadata.
Sourcepub const fn source_timestamp(&self) -> Time
pub const fn source_timestamp(&self) -> Time
Timestamp when the message was published.
Sourcepub const fn received_timestamp(&self) -> Time
pub const fn received_timestamp(&self) -> Time
Timestamp when the message was received.
Sourcepub const fn publisher_gid(&self) -> &[u8; 16]
pub const fn publisher_gid(&self) -> &[u8; 16]
Publisher’s Global Identifier (GID).
Trait Implementations§
Source§impl<'a> Clone for RawMessageInfo<'a>
impl<'a> Clone for RawMessageInfo<'a>
Source§fn clone(&self) -> RawMessageInfo<'a>
fn clone(&self) -> RawMessageInfo<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more