pub struct ReliableReader { /* private fields */ }Expand description
A reliable reader: the writer proxies of a stateful reader (8.4.10, 8.4.12.2). Changes are delivered once each and, for each writer, in sequence number order.
Implementations§
Source§impl ReliableReader
impl ReliableReader
Sourcepub fn new(guid: Guid, vendor_id: VendorId, config: ReaderConfig) -> Self
pub fn new(guid: Guid, vendor_id: VendorId, config: ReaderConfig) -> Self
A reader with no matched writers.
Sourcepub fn add_writer(
&mut self,
guid: Guid,
unicast: Vec<Locator>,
multicast: Vec<Locator>,
now: Instant,
)
pub fn add_writer( &mut self, guid: Guid, unicast: Vec<Locator>, multicast: Vec<Locator>, now: Instant, )
Matches a writer (matched_writer_add). An ACKNACK is sent to it
at the next Self::poll, so that it learns about this reader
early (8.4.2.3.4 allows this). Matching a writer again only
updates its locators.
Sourcepub fn remove_writer(&mut self, guid: &Guid) -> bool
pub fn remove_writer(&mut self, guid: &Guid) -> bool
Unmatches a writer (matched_writer_remove).
Sourcepub fn remove_writers_of(&mut self, prefix: &GuidPrefix)
pub fn remove_writers_of(&mut self, prefix: &GuidPrefix)
Unmatches every writer of a participant.
Sourcepub fn handle_data(
&mut self,
writer: Guid,
d: &Data,
timestamp: Option<Time>,
) -> Vec<Change>
pub fn handle_data( &mut self, writer: Guid, d: &Data, timestamp: Option<Time>, ) -> Vec<Change>
Handles a DATA from writer (8.4.12.2.8) and returns the changes
that can now be delivered. DATA from unmatched writers and
duplicates are ignored.
Sourcepub fn handle_data_frag(
&mut self,
writer: Guid,
d: &DataFrag,
timestamp: Option<Time>,
) -> Vec<Change>
pub fn handle_data_frag( &mut self, writer: Guid, d: &DataFrag, timestamp: Option<Time>, ) -> Vec<Change>
Handles a DATA_FRAG from writer (8.4.14.1) and returns the
changes that can now be delivered: once all its fragments are in,
the change is handled like a DATA.
Sourcepub fn handle_gap(&mut self, writer: Guid, g: &Gap) -> Vec<Change>
pub fn handle_gap(&mut self, writer: Guid, g: &Gap) -> Vec<Change>
Handles a GAP from writer (8.4.12.2.9) and returns the changes
that can now be delivered.
Sourcepub fn handle_heartbeat(
&mut self,
writer: Guid,
h: &Heartbeat,
now: Instant,
) -> Vec<Change>
pub fn handle_heartbeat( &mut self, writer: Guid, h: &Heartbeat, now: Instant, ) -> Vec<Change>
Handles a HEARTBEAT from writer (8.4.12.2.7) and returns the
changes that can now be delivered: changes the writer no longer
has are given up on. Duplicates (a count not above the last one)
are ignored.
Sourcepub fn handle_heartbeat_frag(
&mut self,
writer: Guid,
h: &HeartbeatFrag,
now: Instant,
)
pub fn handle_heartbeat_frag( &mut self, writer: Guid, h: &HeartbeatFrag, now: Instant, )
Handles a HEARTBEAT_FRAG from writer (8.3.8.7): the fragments of
a change it says it has, and this reader misses, are asked for
with NACK_FRAG at the next Self::poll. Duplicates are ignored.
Sourcepub fn poll(&mut self, now: Instant) -> Vec<Outgoing>
pub fn poll(&mut self, now: Instant) -> Vec<Outgoing>
Builds the ACKNACKs due at now (8.4.12.2.5).
Sourcepub fn next_deadline(&self) -> Option<Instant>
pub fn next_deadline(&self) -> Option<Instant>
When Self::poll next has something to do, if no message comes
in before.