Skip to main content

ReliableReader

Struct ReliableReader 

Source
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

Source

pub fn new(guid: Guid, vendor_id: VendorId, config: ReaderConfig) -> Self

A reader with no matched writers.

Source

pub fn guid(&self) -> Guid

The reader’s GUID.

Source

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.

Source

pub fn remove_writer(&mut self, guid: &Guid) -> bool

Unmatches a writer (matched_writer_remove).

Source

pub fn remove_writers_of(&mut self, prefix: &GuidPrefix)

Unmatches every writer of a participant.

Source

pub fn writers(&self) -> impl Iterator<Item = &Guid>

The matched writers.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn poll(&mut self, now: Instant) -> Vec<Outgoing>

Builds the ACKNACKs due at now (8.4.12.2.5).

Source

pub fn acknowledge_now(&mut self, now: Instant) -> Vec<Outgoing>

The ACKNACKs (and NACK_FRAGs) of Self::poll for every writer something came from, at once, without waiting for its HEARTBEAT: for a reader about to go away, so that a writer that waits for acknowledgments does not wait for one that will not come.

Source

pub fn next_deadline(&self) -> Option<Instant>

When Self::poll next has something to do, if no message comes in before.

Trait Implementations§

Source§

impl Debug for ReliableReader

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for ReliableReader

§

impl Freeze for ReliableReader
where *const u8 is !null: Freeze, PhantomData<(Guid, WriterProxy)>: Freeze,

§

impl Move for ReliableReader

§

impl RefUnwindSafe for ReliableReader

§

impl Send for ReliableReader
where RawTable<(Guid, WriterProxy)>: Send,

§

impl Sync for ReliableReader
where RawTable<(Guid, WriterProxy)>: Sync,

§

impl Unpin for ReliableReader
where *const u8 is !null: Unpin, *const LeafNode<SequenceNumber, Pending> is !null: Unpin, Box<(SequenceNumber, Pending)>: Unpin, *const LeafNode<SequenceNumber, Partial> is !null: Unpin, Box<(SequenceNumber, Partial)>: Unpin, *const LeafNode<SequenceNumber, FragmentNumber> is !null: Unpin, Box<(SequenceNumber, FragmentNumber)>: Unpin,

§

impl UnsafeUnpin for ReliableReader
where *const u8 is !null: UnsafeUnpin, PhantomData<(Guid, WriterProxy)>: UnsafeUnpin,

§

impl UnwindSafe for ReliableReader
where HashMap<Guid, WriterProxy>: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.