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: u64Sequence 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 - 1is 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 = 0if and only if the messages were sent by the publisher consecutively.
reception_sequence_number: u64Sequence 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 + 1if and only if both messages were received consecutively.
publisher_gid: PublisherGidAn identifier for the publisher that sent the message.
Trait Implementations§
Source§impl Clone for MessageInfo
impl Clone for MessageInfo
Source§fn clone(&self) -> MessageInfo
fn clone(&self) -> MessageInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageInfo
impl Debug for MessageInfo
Source§impl Hash for MessageInfo
impl Hash for MessageInfo
Source§impl Ord for MessageInfo
impl Ord for MessageInfo
Source§fn cmp(&self, other: &MessageInfo) -> Ordering
fn cmp(&self, other: &MessageInfo) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MessageInfo
impl PartialEq for MessageInfo
Source§impl PartialOrd for MessageInfo
impl PartialOrd for MessageInfo
impl Eq for MessageInfo
impl StructuralPartialEq for MessageInfo
Auto Trait Implementations§
impl Freeze for MessageInfo
impl RefUnwindSafe for MessageInfo
impl Send for MessageInfo
impl Sync for MessageInfo
impl Unpin for MessageInfo
impl UnwindSafe for MessageInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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