pub enum UserSample {
Alive {
payload: SampleBytes,
writer_guid: [u8; 16],
writer_strength: i32,
representation: u8,
big_endian: bool,
source_timestamp: Option<HeTimestamp>,
},
Lifecycle {
key_hash: [u8; 16],
kind: ChangeKind,
},
}Expand description
Sample channel item: either data payload or lifecycle marker.
Lifecycle is reconstructed by the wire path as key_hash + ChangeKind from
the PID_STATUS_INFO header; the DataReader DCPS layer
translates that into __push_lifecycle.
Variants§
Alive
Normal sample with payload (CDR-encoded application type).
writer_guid is the 16-byte GUID of the emitting writer
— needed by the subscriber for exclusive-ownership resolution
(DDS 1.4 §2.2.3.23 / §2.2.2.5.5).
Fields
payload: SampleBytesCDR payload (without encapsulation header). Zero-copy container:
typically holds an Arc<[u8]> slice into the RTPS wire datagram
without a heap re-alloc. See docs/specs/zerodds-zero-copy-1.0.md.
writer_strength: i32Writer ownership_strength at the time of receipt.
0 if the writer is not yet known via discovery
(the reader treats this as default strength = spec-conformant
for shared-ownership topics; for exclusive the
reader filters the real strength against the current owner).
representation: u8XCDR version of the payload — extracted from the encapsulation
header of the wire sample (RTPS 2.5 §10.5) BEFORE the
header was stripped: 0 = XCDR1 (CDR/PL_CDR), 1 =
XCDR2 (CDR2/D_CDR2/PL_CDR2). The typed consumer
needs this to decode the body with the correct alignment rule
(XTypes 1.3 §7.4.3.4.2).
big_endian: boolByte order of the payload — extracted from the encapsulation
representation identifier’s low bit (RTPS 2.5 §10.5: the _BE
variants 0x0000/0x0002/0x0006/0x0008/0x000a are even, the _LE
variants odd). false = little-endian (the canonical wire and the
intra-runtime default), true = big-endian. The typed consumer
dispatches DdsType::decode vs decode_be on this.
source_timestamp: Option<HeTimestamp>Source timestamp from the writer’s INFO_TS submessage (DDSI-RTPS
§8.7.3), if any. Threaded into SampleInfo.source_timestamp and the
DESTINATION_ORDER = BY_SOURCE_TIMESTAMP decision. None ⇒ the
reader uses reception order.
Lifecycle
Lifecycle marker (dispose / unregister) — the reader sets InstanceState accordingly.
Fields
kind: ChangeKindNotAliveDisposed / NotAliveUnregistered /
NotAliveDisposedUnregistered.
Trait Implementations§
Source§impl Clone for UserSample
impl Clone for UserSample
Source§fn clone(&self) -> UserSample
fn clone(&self) -> UserSample
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more