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