pub struct CacheChange {
pub sequence_number: SequenceNumber,
pub payload: Arc<[u8]>,
pub kind: ChangeKind,
pub key_hash: Option<[u8; 16]>,
pub source_timestamp: Option<HeTimestamp>,
}Expand description
Single cache entry.
payload is held as Arc<[u8]> — the cache, the writer build-
datagram path and reader delivery share a single
allocation. This saves the n-fold Vec::clone() per reader proxy
in the reliable-writer tick (perf audit F7/F8/F10, ~30-50 %
throughput gain for large payloads).
Fields§
§sequence_number: SequenceNumberSequence number (writer-locally unique).
payload: Arc<[u8]>Payload (serialized sample), reference-counted.
kind: ChangeKindKind of the event.
key_hash: Option<[u8; 16]>Optional PID_KEY_HASH from the inline QoS (Spec §9.6.4.8).
Reader side: filled for keyed topics + ALIVE samples with an inline hash
or for lifecycle markers (Disposed/Unregistered)
by the reader path. Writer side: set by the writer when the path
propagates the hash along the sample pipeline.
source_timestamp: Option<HeTimestamp>Source timestamp of the write (DDSI-RTPS §8.3.7.9 / §8.7.3). When set,
the writer prepends an INFO_TS submessage before the DATA so a remote
reader can populate SampleInfo.source_timestamp and apply
DESTINATION_ORDER = BY_SOURCE_TIMESTAMP. None ⇒ no INFO_TS (the
reader falls back to reception order). Held on the change so retransmits
carry the original timestamp, not the resend wall-clock.
Implementations§
Source§impl CacheChange
impl CacheChange
Sourcepub fn alive(sn: SequenceNumber, payload: Vec<u8>) -> Self
pub fn alive(sn: SequenceNumber, payload: Vec<u8>) -> Self
Creates an alive change. Takes Vec<u8> and
converts once into Arc<[u8]>. For call sites that already have the
allocation as an Arc, there is Self::alive_arc.
Sourcepub fn with_source_timestamp(self, ts: Option<HeTimestamp>) -> Self
pub fn with_source_timestamp(self, ts: Option<HeTimestamp>) -> Self
Attaches a source timestamp (builder style). The writer emits an INFO_TS submessage before the DATA for any change that carries one.
Sourcepub fn lifecycle(sn: SequenceNumber, payload: Vec<u8>, kind: ChangeKind) -> Self
pub fn lifecycle(sn: SequenceNumber, payload: Vec<u8>, kind: ChangeKind) -> Self
Creates a lifecycle marker (Spec §8.2.1.2). payload is the
key-only serialization of the disposed/unregistered instance —
exactly what lands as PID_KEY_HASH in the inline QoS.
Trait Implementations§
Source§impl Clone for CacheChange
impl Clone for CacheChange
Source§fn clone(&self) -> CacheChange
fn clone(&self) -> CacheChange
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 CacheChange
impl Debug for CacheChange
impl Eq for CacheChange
Source§impl PartialEq for CacheChange
impl PartialEq for CacheChange
Source§fn eq(&self, other: &CacheChange) -> bool
fn eq(&self, other: &CacheChange) -> bool
self and other values to be equal, and is used by ==.