pub struct ReliableReader { /* private fields */ }Expand description
A reliable reader with 0..N writer proxies.
Implementations§
Source§impl ReliableReader
impl ReliableReader
Sourcepub fn new(cfg: ReliableReaderConfig) -> Self
pub fn new(cfg: ReliableReaderConfig) -> Self
Sourcepub fn set_best_effort(&mut self, best_effort: bool)
pub fn set_best_effort(&mut self, best_effort: bool)
Marks this reader as BEST_EFFORT (true) or RELIABLE (false, the
default). Best-effort readers skip leading gaps instead of waiting (see
the best_effort field).
Sourcepub fn writer_proxies(&self) -> &[WriterProxyState]
pub fn writer_proxies(&self) -> &[WriterProxyState]
Read-only slice of the writer-proxy states.
Sourcepub fn writer_proxy_count(&self) -> usize
pub fn writer_proxy_count(&self) -> usize
Number of registered writer proxies.
Sourcepub fn acknack_count(&self) -> i32
pub fn acknack_count(&self) -> i32
Counter of sent ACKNACKs.
Sourcepub fn nackfrag_count(&self) -> i32
pub fn nackfrag_count(&self) -> i32
Counter of sent NACK_FRAGs.
Sourcepub fn pending_fragment_count(&self) -> usize
pub fn pending_fragment_count(&self) -> usize
Sum of the active (incomplete) fragment buffers across all proxies.
Sourcepub fn dropped_fragment_count(&self) -> u64
pub fn dropped_fragment_count(&self) -> u64
Sum of the dropped fragments across all proxies (DoS / inconsistency diagnosis).
Sourcepub fn duplicate_fragment_count(&self) -> u64
pub fn duplicate_fragment_count(&self) -> u64
Number of DATA_FRAGs that arrived for already-known SNs (duplicate fragments, re-sends).
Sourcepub fn unknown_src_count(&self) -> u64
pub fn unknown_src_count(&self) -> u64
Number of submessages whose writer_id could not be assigned to a registered
proxy (misrouting / spoofing diagnosis).
Sourcepub fn add_writer_proxy(&mut self, proxy: WriterProxy)
pub fn add_writer_proxy(&mut self, proxy: WriterProxy)
Adds a writer proxy. Idempotent: for a known GUID the reliability state (SN bounds, received cache, delivered pointer) is preserved — only the locators are refreshed.
Sets a preemptive ACKNACK as pending, so the writer gets a “hello, I’m here” ACKNACK on the next tick. Cyclone DDS responds with a HEARTBEAT and starts DATA resends — without this impulse the writer waits passively.
Important: a renewed SPDP/SEDP announce of the same writer (Cyclone re-announces periodically) must NOT discard the reader progress. A reset would, after an already-processed HEARTBEAT, produce an empty ACKNACK (“nothing missing”) → the reliable writer never delivers the DATA (cross-vendor secure-SEDP deadlock).
Sourcepub fn remove_writer_proxy(&mut self, guid: Guid) -> Option<WriterProxy>
pub fn remove_writer_proxy(&mut self, guid: Guid) -> Option<WriterProxy>
Removes a writer proxy.
Sourcepub fn reset_diagnostics(&mut self)
pub fn reset_diagnostics(&mut self)
Zeroes all diagnostic counters. Touches no state machine.
Sourcepub fn handle_data(
&mut self,
source_prefix: GuidPrefix,
data: &DataSubmessage,
source_timestamp: Option<HeTimestamp>,
) -> Vec<DeliveredSample>
pub fn handle_data( &mut self, source_prefix: GuidPrefix, data: &DataSubmessage, source_timestamp: Option<HeTimestamp>, ) -> Vec<DeliveredSample>
Process a DATA. Dispatch by writer_id to the matching
proxy. Returns the reassembled samples of this proxy.
Spec §9.6.3.9 PID_STATUS_INFO: with key_flag=true + inline QoS
with STATUS_INFO set, the CacheChange is marked
NotAliveDisposed / NotAliveUnregistered / NotAliveDisposedUnregistered
instead of Alive.
Sourcepub fn handle_data_frag(
&mut self,
source_prefix: GuidPrefix,
df: &DataFragSubmessage,
now: Duration,
source_timestamp: Option<HeTimestamp>,
) -> Vec<DeliveredSample>
pub fn handle_data_frag( &mut self, source_prefix: GuidPrefix, df: &DataFragSubmessage, now: Duration, source_timestamp: Option<HeTimestamp>, ) -> Vec<DeliveredSample>
Process a DATA_FRAG. now triggers NACK_FRAG scheduling
directly, without waiting for a HEARTBEAT.
Sourcepub fn handle_heartbeat(
&mut self,
source_prefix: GuidPrefix,
hb: &HeartbeatSubmessage,
now: Duration,
) -> Vec<DeliveredSample>
pub fn handle_heartbeat( &mut self, source_prefix: GuidPrefix, hb: &HeartbeatSubmessage, now: Duration, ) -> Vec<DeliveredSample>
Process a HEARTBEAT. Dispatch by writer_id.
Sourcepub fn handle_gap(
&mut self,
source_prefix: GuidPrefix,
gap: &GapSubmessage,
) -> Vec<DeliveredSample>
pub fn handle_gap( &mut self, source_prefix: GuidPrefix, gap: &GapSubmessage, ) -> Vec<DeliveredSample>
Process a GAP. Dispatch by writer_id.
Sourcepub fn tick(&mut self, now: Duration) -> Result<Vec<Vec<u8>>, WireError>
pub fn tick(&mut self, now: Duration) -> Result<Vec<Vec<u8>>, WireError>
Tick: returns due ACKNACK/NACK_FRAG datagrams across all proxies. Per proxy its own ACKNACK/NACK_FRAG, because SN spaces are per writer.
§Errors
Wire encode error.
Sourcepub fn tick_outbound(
&mut self,
now: Duration,
) -> Result<Vec<OutboundDatagram>, WireError>
pub fn tick_outbound( &mut self, now: Duration, ) -> Result<Vec<OutboundDatagram>, WireError>
Like Self::tick, but with target locators for each datagram.
Preferred for transport integration, because each AckNack must go to
the concrete writer-proxy unicast locator.
§Errors
WireError::ValueOutOfRange for an overlong submessage body.
Trait Implementations§
Source§impl Clone for ReliableReader
impl Clone for ReliableReader
Source§fn clone(&self) -> ReliableReader
fn clone(&self) -> ReliableReader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more