pub struct DiscoveredEndpointsCache { /* private fields */ }Expand description
In-memory cache for SEDP-discovered endpoints.
Implementations§
Source§impl DiscoveredEndpointsCache
impl DiscoveredEndpointsCache
Sourcepub fn publications_len(&self) -> usize
pub fn publications_len(&self) -> usize
Total number of publications.
Sourcepub fn subscriptions_len(&self) -> usize
pub fn subscriptions_len(&self) -> usize
Total number of subscriptions.
Sourcepub fn evicted_count(&self) -> u64
pub fn evicted_count(&self) -> u64
Number of LRU evictions since start (DoS diagnostics).
Sourcepub fn publication(&self, key: Guid) -> Option<&DiscoveredPublication>
pub fn publication(&self, key: Guid) -> Option<&DiscoveredPublication>
Looks up a publication by endpoint GUID.
Sourcepub fn subscription(&self, key: Guid) -> Option<&DiscoveredSubscription>
pub fn subscription(&self, key: Guid) -> Option<&DiscoveredSubscription>
Looks up a subscription by endpoint GUID.
Sourcepub fn publications_for(
&self,
prefix: GuidPrefix,
) -> impl Iterator<Item = &DiscoveredPublication> + '_
pub fn publications_for( &self, prefix: GuidPrefix, ) -> impl Iterator<Item = &DiscoveredPublication> + '_
Iterates all publications of a remote participant.
Sourcepub fn subscriptions_for(
&self,
prefix: GuidPrefix,
) -> impl Iterator<Item = &DiscoveredSubscription> + '_
pub fn subscriptions_for( &self, prefix: GuidPrefix, ) -> impl Iterator<Item = &DiscoveredSubscription> + '_
Iterates all subscriptions of a remote participant.
Sourcepub fn publications(&self) -> impl Iterator<Item = &DiscoveredPublication> + '_
pub fn publications(&self) -> impl Iterator<Item = &DiscoveredPublication> + '_
Iterates all publications (for the matching scan).
Sourcepub fn subscriptions(
&self,
) -> impl Iterator<Item = &DiscoveredSubscription> + '_
pub fn subscriptions( &self, ) -> impl Iterator<Item = &DiscoveredSubscription> + '_
Iterates all subscriptions.
Sourcepub fn insert_publication(
&mut self,
data: PublicationBuiltinTopicData,
now: Duration,
) -> bool
pub fn insert_publication( &mut self, data: PublicationBuiltinTopicData, now: Duration, ) -> bool
Insert or update of a publication. Idempotent: for an
already-present GUID, data is overwritten and discovered_at is
updated — no eviction round.
On a new insert: if this participant’s publication count reaches
the cap, the oldest publication of the same participant is
discarded (LRU) and evicted_count is incremented.
Returns: true = newly inserted, false = update.
Sourcepub fn insert_subscription(
&mut self,
data: SubscriptionBuiltinTopicData,
now: Duration,
) -> bool
pub fn insert_subscription( &mut self, data: SubscriptionBuiltinTopicData, now: Duration, ) -> bool
Insert or update of a subscription. Semantics analogous to
Self::insert_publication.
Sourcepub fn remove_publication(&mut self, key: Guid) -> Option<DiscoveredPublication>
pub fn remove_publication(&mut self, key: Guid) -> Option<DiscoveredPublication>
Removes a publication by GUID (e.g. after an explicit withdrawal notification from the remote).
Sourcepub fn remove_subscription(
&mut self,
key: Guid,
) -> Option<DiscoveredSubscription>
pub fn remove_subscription( &mut self, key: Guid, ) -> Option<DiscoveredSubscription>
Removes a subscription by GUID.
Sourcepub fn on_participant_lost(&mut self, prefix: GuidPrefix) -> (usize, usize)
pub fn on_participant_lost(&mut self, prefix: GuidPrefix) -> (usize, usize)
Removes all publications and subscriptions of a remote participant. Called e.g. on an SPDP lease timeout.
Returns: (removed_pubs, removed_subs).
Sourcepub fn match_publications<'a>(
&'a self,
topic: &'a str,
type_name: &'a str,
) -> impl Iterator<Item = &'a DiscoveredPublication> + 'a
pub fn match_publications<'a>( &'a self, topic: &'a str, type_name: &'a str, ) -> impl Iterator<Item = &'a DiscoveredPublication> + 'a
Finds all publications matching a (topic_name, type_name) —
for reader-side matching (T4/T5).
Sourcepub fn match_subscriptions<'a>(
&'a self,
topic: &'a str,
type_name: &'a str,
) -> impl Iterator<Item = &'a DiscoveredSubscription> + 'a
pub fn match_subscriptions<'a>( &'a self, topic: &'a str, type_name: &'a str, ) -> impl Iterator<Item = &'a DiscoveredSubscription> + 'a
Finds all subscriptions matching a (topic_name, type_name) —
for writer-side matching.
Sourcepub fn publication_keys(&self) -> Vec<Guid>
pub fn publication_keys(&self) -> Vec<Guid>
Collects the GUIDs of all publications (for snapshot tests / diagnostics).
Sourcepub fn topic_name_conflicts(&self, topic: &str, type_name: &str) -> bool
pub fn topic_name_conflicts(&self, topic: &str, type_name: &str) -> bool
True if any discovered publication OR subscription carries the given
topic_name but a different type_name — the DDS 1.4 §2.2.4.2.4
inconsistent-topic condition (same topic, incompatible type). Used by
the matching path to raise on_inconsistent_topic.
Trait Implementations§
Source§impl Clone for DiscoveredEndpointsCache
impl Clone for DiscoveredEndpointsCache
Source§fn clone(&self) -> DiscoveredEndpointsCache
fn clone(&self) -> DiscoveredEndpointsCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more