pub struct ReceiverState {
pub source_version: ProtocolVersion,
pub source_vendor_id: VendorId,
pub source_guid_prefix: GuidPrefix,
pub dest_guid_prefix: GuidPrefix,
pub have_timestamp: bool,
pub timestamp: HeTimestamp,
pub message_length: Option<u32>,
pub message_checksum: ChecksumValue,
pub parameters: Option<ParameterList>,
pub unicast_reply_locator_list: Vec<Locator>,
pub multicast_reply_locator_list: Vec<Locator>,
pub clock_skew_detected: bool,
}Expand description
Receiver-State entsprechend Spec-Tabelle §8.3.4 und Update-Regeln in §8.3.7.4.
Fields§
§source_version: ProtocolVersionProtocolVersion aus RTPS-Header (oder von InfoSource ueberschrieben).
source_vendor_id: VendorIdVendorId aus RTPS-Header (oder von InfoSource ueberschrieben).
source_guid_prefix: GuidPrefixGuidPrefix des Senders (RTPS-Header oder InfoSource).
dest_guid_prefix: GuidPrefixGuidPrefix des Receivers (Konfigurations-Wert, fix).
have_timestamp: booltrue wenn der Receiver einen Sender-Timestamp hat.
timestamp: HeTimestampLetzter Sender-Timestamp (gueltig wenn have_timestamp).
message_length: Option<u32>Gesetzt durch HE.L — Soll-Restlaenge der RTPS-Message.
message_checksum: ChecksumValueGesetzt durch HE.C — Soll-Checksum der RTPS-Message.
parameters: Option<ParameterList>Gesetzt durch HE.P — ParameterList aus dem HE.
unicast_reply_locator_list: Vec<Locator>Reply-Locator-Listen (Default LOCATOR_INVALID-Listen, von
InfoReply ueberschreibbar).
multicast_reply_locator_list: Vec<Locator>Reply-Locator-Listen (Default LOCATOR_INVALID-Listen, von
InfoReply ueberschreibbar).
clock_skew_detected: boolHeuristik-Flag: |timestamp - now| > Schwelle. Wird von
note_clock_skew gesetzt; das Decode-Modul liefert nur die
Eingangsdaten.
Implementations§
Source§impl ReceiverState
impl ReceiverState
Sourcepub fn new(dest_guid_prefix: GuidPrefix) -> Self
pub fn new(dest_guid_prefix: GuidPrefix) -> Self
Initial-Zustand vor Empfang einer Message: alle Felder auf
Spec-Defaults, dest_guid_prefix aus dem Receiver-Konfig
uebernommen.
Sourcepub fn init_from_header(&mut self, header: &RtpsHeader)
pub fn init_from_header(&mut self, header: &RtpsHeader)
Initialisiert aus einem RtpsHeader (Spec §8.3.4.1).
Sourcepub fn apply_info_source(
&mut self,
version: ProtocolVersion,
vendor_id: VendorId,
guid_prefix: GuidPrefix,
)
pub fn apply_info_source( &mut self, version: ProtocolVersion, vendor_id: VendorId, guid_prefix: GuidPrefix, )
Update aus einer InfoSource-Submessage (§8.3.8.9.4).
“An InfoSource Submessage MUST set the receiver’s source GuidPrefix, source ProtocolVersion, source VendorId, and MUST reset haveTimestamp = false and the reply-locator-lists to LOCATOR_INVALID.”
Sourcepub fn apply_info_timestamp(&mut self, ts: HeTimestamp, invalidate: bool)
pub fn apply_info_timestamp(&mut self, ts: HeTimestamp, invalidate: bool)
Update aus InfoTimestamp (§8.3.8.5.4). invalidate = true (also
das I-Flag in der Submessage) loescht den Timestamp.
Sourcepub fn apply_info_reply(
&mut self,
unicast: Vec<Locator>,
multicast: Option<Vec<Locator>>,
)
pub fn apply_info_reply( &mut self, unicast: Vec<Locator>, multicast: Option<Vec<Locator>>, )
Update aus InfoReply (§8.3.8.10.4): setzt die beiden Reply- Locator-Listen.
Sourcepub fn apply_header_extension(&mut self, he: &HeaderExtension)
pub fn apply_header_extension(&mut self, he: &HeaderExtension)
Update aus HeaderExtension (§8.3.7.4). Aktualisiert je nach
gesetzten Flags messageLength, timestamp, messageChecksum
und parameters.
Sourcepub fn note_clock_skew(&mut self, now_seconds: i32, threshold_seconds: u32)
pub fn note_clock_skew(&mut self, now_seconds: i32, threshold_seconds: u32)
Setzt das clock_skew_detected-Flag, wenn der gegebene
now-Sekunden-Wert mehr als threshold_seconds vom Sender-
Timestamp abweicht. No-op wenn !have_timestamp.
Trait Implementations§
Source§impl Clone for ReceiverState
impl Clone for ReceiverState
Source§fn clone(&self) -> ReceiverState
fn clone(&self) -> ReceiverState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReceiverState
impl Debug for ReceiverState
Source§impl PartialEq for ReceiverState
impl PartialEq for ReceiverState
Source§fn eq(&self, other: &ReceiverState) -> bool
fn eq(&self, other: &ReceiverState) -> bool
self and other values to be equal, and is used by ==.