Skip to main content

ReaderProxy

Struct ReaderProxy 

Source
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: Guid

GUID 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: bool

Reliable kind (always true in WP 1.1).

Implementations§

Source§

impl ReaderProxy

Source

pub fn new( remote_reader_guid: Guid, unicast_locators: Vec<Locator>, multicast_locators: Vec<Locator>, is_reliable: bool, ) -> Self

Creates a fresh proxy.

Source

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(...).

Source

pub fn negotiated_data_representation(&self) -> i16

Returns the negotiated wire format.

Source

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).

Source

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.

Source

pub fn last_activity(&self) -> Duration

Returns the last-activity timestamp (diagnosis).

Source

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”.

Source

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.

Source

pub fn requested_changes_set( &mut self, sns: impl IntoIterator<Item = SequenceNumber>, )

Remembers the SNs requested in the ACKNACK bitmap for re-send.

Source

pub fn next_requested_change(&mut self) -> Option<SequenceNumber>

Pulls the smallest open requested SN and removes it.

Source

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.

Source

pub fn unacked_changes(&self, cache_max: SequenceNumber) -> bool

True if there are still unacknowledged samples between highest_acked and cache_max.

Source

pub fn highest_acked_sn(&self) -> SequenceNumber

Getter for highest_acked_sn.

Source

pub fn highest_sent_sn(&self) -> SequenceNumber

Getter for highest_sent_sn.

Source

pub fn pending_requested_count(&self) -> usize

Number of queued resend requests.

Source

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.

Source

pub fn next_requested_fragment( &mut self, ) -> Option<(SequenceNumber, FragmentNumber)>

Pulls the smallest open (SN, FragmentNumber) pair and removes it.

Source

pub fn pending_requested_fragment_count(&self) -> usize

Number of queued fragment resends (sum over all SNs).

Trait Implementations§

Source§

impl Clone for ReaderProxy

Source§

fn clone(&self) -> ReaderProxy

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReaderProxy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.