rclrs

Struct MessageInfo

Source
pub struct MessageInfo {
    pub source_timestamp: Option<SystemTime>,
    pub received_timestamp: Option<SystemTime>,
    pub publication_sequence_number: u64,
    pub reception_sequence_number: u64,
    pub publisher_gid: PublisherGid,
}
Expand description

Additional information about a received message.

Fields§

§source_timestamp: Option<SystemTime>

Time when the message was published by the publisher.

The rmw layer does not specify the exact point at which the RMW implementation must take the timestamp, but it should be taken consistently at the same point in the process of publishing a message.

§received_timestamp: Option<SystemTime>

Time when the message was received by the subscription.

The rmw layer does not specify the exact point at which the RMW implementation must take the timestamp, but it should be taken consistently at the same point in the process of receiving a message.

§publication_sequence_number: u64

Sequence number of the received message set by the publisher.

This sequence number is set by the publisher and therefore uniquely identifies a message when combined with the publisher GID. For long running applications, the sequence number might wrap around at some point.

If the RMW implementation doesn’t support sequence numbers, its value will be u64::MAX.

Requirements:

If psn1 and psn2 are the publication sequence numbers received together with two messages, where psn1 was obtained before psn2 and both sequence numbers are from the same publisher (i.e. also same publisher gid), then:

  • psn2 > psn1 (except in the case of a wrap around)
  • psn2 - psn1 - 1 is the number of messages the publisher sent in the middle of both received messages. Those might have already been taken by other messages that were received in between or lost. psn2 - psn1 - 1 = 0 if and only if the messages were sent by the publisher consecutively.
§reception_sequence_number: u64

Sequence number of the received message set by the subscription.

This sequence number is set by the subscription regardless of which publisher sent the message. For long running applications, the sequence number might wrap around at some point.

If the RMW implementation doesn’t support sequence numbers, its value will be u64::MAX.

Requirements:

If rsn1 and rsn2 are the reception sequence numbers received together with two messages, where rsn1 was obtained before rsn2, then:

  • rsn2 > rsn1 (except in the case of a wrap around)
  • rsn2 = rsn1 + 1 if and only if both messages were received consecutively.
§publisher_gid: PublisherGid

An identifier for the publisher that sent the message.

Trait Implementations§

Source§

impl Clone for MessageInfo

Source§

fn clone(&self) -> MessageInfo

Returns a copy 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 Debug for MessageInfo

Source§

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

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

impl PartialEq for MessageInfo

Source§

fn eq(&self, other: &MessageInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for MessageInfo

Source§

impl StructuralPartialEq for MessageInfo

Auto Trait Implementations§

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.