pub struct ReaderProxy {
pub remote_reader_guid: Guid,
pub unicast_locators: Vec<Locator>,
pub multicast_locators: Vec<Locator>,
pub is_reliable: bool,
/* private fields */
}Expand description
Writer-side state for one remote reader.
Fields§
§remote_reader_guid: GuidGUID of the remote reader endpoint.
unicast_locators: Vec<Locator>Unicast receive locator(s) of the reader.
multicast_locators: Vec<Locator>Multicast receive locator(s).
is_reliable: boolReliable kind (always true in WP 1.1).
Implementations§
Source§impl ReaderProxy
impl ReaderProxy
Sourcepub fn new(
remote_reader_guid: Guid,
unicast_locators: Vec<Locator>,
multicast_locators: Vec<Locator>,
is_reliable: bool,
) -> Self
pub fn new( remote_reader_guid: Guid, unicast_locators: Vec<Locator>, multicast_locators: Vec<Locator>, is_reliable: bool, ) -> Self
Creates a fresh proxy.
Sourcepub fn set_negotiated_data_representation(&mut self, id: i16)
pub fn set_negotiated_data_representation(&mut self, id: i16)
Sets the negotiated wire format for this reader.
Called by the DCPS-SEDP match path after negotiate(...).
Sourcepub fn negotiated_data_representation(&self) -> i16
pub fn negotiated_data_representation(&self) -> i16
Returns the negotiated wire format.
Sourcepub fn note_activity(&mut self, now: Duration)
pub fn note_activity(&mut self, now: Duration)
Spec §8.4.15.6 — marks incoming reader activity (every ACKNACK / NACK_FRAG calls this from the receiver path).
Sourcepub fn is_inactive(&self, now: Duration, threshold: Duration) -> bool
pub fn is_inactive(&self, now: Duration, threshold: Duration) -> bool
Spec §8.4.15.6 — true if the reader has shown no activity for
longer than threshold. The caller (e.g. ReliableWriter)
uses this to reclaim the proxy from the matched_readers list,
so that strict reliability does not run the cache OOM.
Sourcepub fn last_activity(&self) -> Duration
pub fn last_activity(&self) -> Duration
Returns the last-activity timestamp (diagnosis).
Sourcepub fn skip_samples_up_to(&mut self, sn: SequenceNumber)
pub fn skip_samples_up_to(&mut self, sn: SequenceNumber)
Marks samples up to and including sn as “no longer
relevant” for this proxy — both sent and
acked. Called e.g. for volatile durability when a
new reader proxy is added: it should not get historic samples,
so we jump directly to the current cache
state.
Spec reference: OMG DDS 1.4 §2.2.3.4 DurabilityQosPolicy Volatile: “The Service will not attempt to retain old data beyond what is currently held by the DataWriter for live Readers”.
Sourcepub fn acked_changes_set(&mut self, base: SequenceNumber)
pub fn acked_changes_set(&mut self, base: SequenceNumber)
Updates to the ACKNACK base — the reader has acked all SNs < base.
base corresponds to reader_sn_state.bitmap_base.
Sourcepub fn requested_changes_set(
&mut self,
sns: impl IntoIterator<Item = SequenceNumber>,
)
pub fn requested_changes_set( &mut self, sns: impl IntoIterator<Item = SequenceNumber>, )
Remembers the SNs requested in the ACKNACK bitmap for re-send.
Sourcepub fn next_requested_change(&mut self) -> Option<SequenceNumber>
pub fn next_requested_change(&mut self) -> Option<SequenceNumber>
Pulls the smallest open requested SN and removes it.
Sourcepub fn next_unsent_change(
&mut self,
cache_max: SequenceNumber,
) -> Option<SequenceNumber>
pub fn next_unsent_change( &mut self, cache_max: SequenceNumber, ) -> Option<SequenceNumber>
Returns the next not-yet-sent SN, if present in the cache.
cache_max is the largest SN currently in the writer cache.
Sourcepub fn unacked_changes(&self, cache_max: SequenceNumber) -> bool
pub fn unacked_changes(&self, cache_max: SequenceNumber) -> bool
True if there are still unacknowledged samples between highest_acked
and cache_max.
Sourcepub fn highest_acked_sn(&self) -> SequenceNumber
pub fn highest_acked_sn(&self) -> SequenceNumber
Getter for highest_acked_sn.
Sourcepub fn highest_sent_sn(&self) -> SequenceNumber
pub fn highest_sent_sn(&self) -> SequenceNumber
Getter for highest_sent_sn.
Sourcepub fn pending_requested_count(&self) -> usize
pub fn pending_requested_count(&self) -> usize
Number of queued resend requests.
Sourcepub fn requested_fragments_set(
&mut self,
sn: SequenceNumber,
fragments: impl IntoIterator<Item = FragmentNumber>,
)
pub fn requested_fragments_set( &mut self, sn: SequenceNumber, fragments: impl IntoIterator<Item = FragmentNumber>, )
Remembers fragment-granular resend requests from a NACK_FRAG.
SN values ≤ highest_acked_sn are ignored.
Sourcepub fn next_requested_fragment(
&mut self,
) -> Option<(SequenceNumber, FragmentNumber)>
pub fn next_requested_fragment( &mut self, ) -> Option<(SequenceNumber, FragmentNumber)>
Pulls the smallest open (SN, FragmentNumber) pair and removes it.
Sourcepub fn pending_requested_fragment_count(&self) -> usize
pub fn pending_requested_fragment_count(&self) -> usize
Number of queued fragment resends (sum over all SNs).
Trait Implementations§
Source§impl Clone for ReaderProxy
impl Clone for ReaderProxy
Source§fn clone(&self) -> ReaderProxy
fn clone(&self) -> ReaderProxy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more