Skip to main content

ReceiverState

Struct ReceiverState 

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

ProtocolVersion aus RTPS-Header (oder von InfoSource ueberschrieben).

§source_vendor_id: VendorId

VendorId aus RTPS-Header (oder von InfoSource ueberschrieben).

§source_guid_prefix: GuidPrefix

GuidPrefix des Senders (RTPS-Header oder InfoSource).

§dest_guid_prefix: GuidPrefix

GuidPrefix des Receivers (Konfigurations-Wert, fix).

§have_timestamp: bool

true wenn der Receiver einen Sender-Timestamp hat.

§timestamp: HeTimestamp

Letzter Sender-Timestamp (gueltig wenn have_timestamp).

§message_length: Option<u32>

Gesetzt durch HE.L — Soll-Restlaenge der RTPS-Message.

§message_checksum: ChecksumValue

Gesetzt 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: bool

Heuristik-Flag: |timestamp - now| > Schwelle. Wird von note_clock_skew gesetzt; das Decode-Modul liefert nur die Eingangsdaten.

Implementations§

Source§

impl ReceiverState

Source

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.

Source

pub fn init_from_header(&mut self, header: &RtpsHeader)

Initialisiert aus einem RtpsHeader (Spec §8.3.4.1).

Source

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.”

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> ReceiverState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ReceiverState

Source§

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

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

impl PartialEq for ReceiverState

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 ReceiverState

Source§

impl StructuralPartialEq for ReceiverState

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, 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.