pub struct ParticipantMessageData {
pub participant_guid: [u8; 16],
pub kind: u32,
pub data: Vec<u8>,
}Expand description
ParticipantMessageData (DDSI-RTPS 2.5 §9.6.3.1) — Payload des
DCPSParticipantMessage-Topics.
Fields§
§participant_guid: [u8; 16]16-Byte GUID des Senders (Prefix + EntityId::PARTICIPANT). Auch wenn die Spec “Prefix” sagt, schreiben Cyclone und Fast- DDS hier den vollen Guid; wir folgen.
kind: u32Liveliness-Kind (siehe PARTICIPANT_MESSAGE_DATA_KIND_*).
data: Vec<u8>Opaque Token. Bei MANUAL_BY_TOPIC Topic-Hash, sonst leer.
Implementations§
Source§impl ParticipantMessageData
impl ParticipantMessageData
Sourcepub fn automatic(prefix: GuidPrefix) -> Self
pub fn automatic(prefix: GuidPrefix) -> Self
Konstruktor fuer AUTOMATIC-Heartbeat (data leer).
Sourcepub fn manual_by_participant(prefix: GuidPrefix) -> Self
pub fn manual_by_participant(prefix: GuidPrefix) -> Self
Konstruktor fuer MANUAL_BY_PARTICIPANT-Heartbeat (data leer).
Sourcepub fn manual_by_topic(prefix: GuidPrefix, topic_token: Vec<u8>) -> Self
pub fn manual_by_topic(prefix: GuidPrefix, topic_token: Vec<u8>) -> Self
Konstruktor fuer ZeroDDS-MANUAL_BY_TOPIC (data = Topic-Token).
Sourcepub fn to_cdr(&self, little_endian: bool) -> Result<Vec<u8>, WireError>
pub fn to_cdr(&self, little_endian: bool) -> Result<Vec<u8>, WireError>
Encoded zu CDR-Bytes (mit 4-byte Encapsulation-Header).
little_endian = true → ENCAPSULATION_CDR_LE, sonst BE.
§Errors
WireError::ValueOutOfRange wenn data.len() > MAX_DATA_LEN.
Sourcepub fn from_cdr(bytes: &[u8]) -> Result<Self, WireError>
pub fn from_cdr(bytes: &[u8]) -> Result<Self, WireError>
Decoded aus CDR-Bytes (mit Encapsulation-Header).
Akzeptiert 0x0000/0x0001 (XCDR1 Plain) und 0x0006/0x0007
(XCDR2 Plain). Andere Encapsulation-Kinds → Fehler.
Tolerant gegenueber 12-Byte-Prefix-Only-Kodierung (fuellt mit 0 auf 16 Byte auf).
§Errors
UnsupportedEncapsulationbei nicht-CDR-EncapsulationUnexpectedEofwenn Bytes zu kurz fuer Header / BodyValueOutOfRangewenndata.len > MAX_DATA_LEN
Sourcepub fn prefix(&self) -> GuidPrefix
pub fn prefix(&self) -> GuidPrefix
Liefert den GuidPrefix (erste 12 Byte).
Sourcepub fn is_vendor_kind(&self) -> bool
pub fn is_vendor_kind(&self) -> bool
true wenn der kind-Wert vendor-spezifisch ist (MSB gesetzt).
Trait Implementations§
Source§impl Clone for ParticipantMessageData
impl Clone for ParticipantMessageData
Source§fn clone(&self) -> ParticipantMessageData
fn clone(&self) -> ParticipantMessageData
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 ParticipantMessageData
impl Debug for ParticipantMessageData
Source§impl PartialEq for ParticipantMessageData
impl PartialEq for ParticipantMessageData
Source§fn eq(&self, other: &ParticipantMessageData) -> bool
fn eq(&self, other: &ParticipantMessageData) -> bool
self and other values to be equal, and is used by ==.