Skip to main content

RawMessageInfo

Struct RawMessageInfo 

Source
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>

Source

pub const fn new(attachment: &'a [u8]) -> RawMessageInfo<'a>

Build from an attachment slice (metadata defaulted).

Source

pub const fn with_info( info: MessageInfo, attachment: &'a [u8], ) -> RawMessageInfo<'a>

Build from explicit metadata + attachment.

Source

pub const fn attachment(&self) -> &'a [u8]

The sample’s wire-level attachment bytes (empty if none).

Source

pub const fn info(&self) -> &MessageInfo

The underlying metadata.

Source

pub const fn source_timestamp(&self) -> Time

Timestamp when the message was published.

Source

pub const fn received_timestamp(&self) -> Time

Timestamp when the message was received.

Source

pub const fn publisher_gid(&self) -> &[u8; 16]

Publisher’s Global Identifier (GID).

Trait Implementations§

Source§

impl<'a> Clone for RawMessageInfo<'a>

Source§

fn clone(&self) -> RawMessageInfo<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for RawMessageInfo<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> Copy for RawMessageInfo<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RawMessageInfo<'a>

§

impl<'a> RefUnwindSafe for RawMessageInfo<'a>

§

impl<'a> Send for RawMessageInfo<'a>

§

impl<'a> Sync for RawMessageInfo<'a>

§

impl<'a> Unpin for RawMessageInfo<'a>

§

impl<'a> UnsafeUnpin for RawMessageInfo<'a>

§

impl<'a> UnwindSafe for RawMessageInfo<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.