pub struct DiscoveredEndpointsCache { /* private fields */ }Expand description
In-memory Cache fuer SEDP-entdeckte Endpoints.
Implementations§
Source§impl DiscoveredEndpointsCache
impl DiscoveredEndpointsCache
Sourcepub fn publications_len(&self) -> usize
pub fn publications_len(&self) -> usize
Anzahl Publications insgesamt.
Sourcepub fn subscriptions_len(&self) -> usize
pub fn subscriptions_len(&self) -> usize
Anzahl Subscriptions insgesamt.
Sourcepub fn evicted_count(&self) -> u64
pub fn evicted_count(&self) -> u64
Anzahl LRU-Evictions seit Start (DoS-Diagnose).
Sourcepub fn publication(&self, key: Guid) -> Option<&DiscoveredPublication>
pub fn publication(&self, key: Guid) -> Option<&DiscoveredPublication>
Lookup einer Publication per Endpoint-GUID.
Sourcepub fn subscription(&self, key: Guid) -> Option<&DiscoveredSubscription>
pub fn subscription(&self, key: Guid) -> Option<&DiscoveredSubscription>
Lookup einer Subscription per Endpoint-GUID.
Sourcepub fn publications_for(
&self,
prefix: GuidPrefix,
) -> impl Iterator<Item = &DiscoveredPublication> + '_
pub fn publications_for( &self, prefix: GuidPrefix, ) -> impl Iterator<Item = &DiscoveredPublication> + '_
Iteriert alle Publications eines Remote-Participants.
Sourcepub fn subscriptions_for(
&self,
prefix: GuidPrefix,
) -> impl Iterator<Item = &DiscoveredSubscription> + '_
pub fn subscriptions_for( &self, prefix: GuidPrefix, ) -> impl Iterator<Item = &DiscoveredSubscription> + '_
Iteriert alle Subscriptions eines Remote-Participants.
Sourcepub fn publications(&self) -> impl Iterator<Item = &DiscoveredPublication> + '_
pub fn publications(&self) -> impl Iterator<Item = &DiscoveredPublication> + '_
Iteriert alle Publications (fuer Matching-Scan).
Sourcepub fn subscriptions(
&self,
) -> impl Iterator<Item = &DiscoveredSubscription> + '_
pub fn subscriptions( &self, ) -> impl Iterator<Item = &DiscoveredSubscription> + '_
Iteriert alle Subscriptions.
Sourcepub fn insert_publication(
&mut self,
data: PublicationBuiltinTopicData,
now: Duration,
) -> bool
pub fn insert_publication( &mut self, data: PublicationBuiltinTopicData, now: Duration, ) -> bool
Insert oder Update einer Publication. Idempotent:
bei bereits vorhandener GUID wird data ueberschrieben und
discovered_at aktualisiert — keine Eviction-Runde.
Bei neuem Insert: wenn die Publications-Zahl dieses Participants
den Cap erreicht, wird die aelteste Publication desselben
Participants verworfen (LRU), evicted_count inkrementiert.
Rueckgabe: true = neu eingefuegt, 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 oder Update einer Subscription. Semantik analog
Self::insert_publication.
Sourcepub fn remove_publication(&mut self, key: Guid) -> Option<DiscoveredPublication>
pub fn remove_publication(&mut self, key: Guid) -> Option<DiscoveredPublication>
Entfernt eine Publication per GUID (z.B. nach expliziter Withdrawal-Notification vom Remote).
Sourcepub fn remove_subscription(
&mut self,
key: Guid,
) -> Option<DiscoveredSubscription>
pub fn remove_subscription( &mut self, key: Guid, ) -> Option<DiscoveredSubscription>
Entfernt eine Subscription per GUID.
Sourcepub fn on_participant_lost(&mut self, prefix: GuidPrefix) -> (usize, usize)
pub fn on_participant_lost(&mut self, prefix: GuidPrefix) -> (usize, usize)
Entfernt alle Publications und Subscriptions eines Remote- Participants. Aufruf z.B. bei SPDP-Lease-Timeout.
Rueckgabe: (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
Findet alle Publications, die zu einem (topic_name, type_name)
passen — fuer Reader-seitiges 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
Findet alle Subscriptions, die zu einem (topic_name, type_name)
passen — fuer Writer-seitiges Matching.
Sourcepub fn publication_keys(&self) -> Vec<Guid>
pub fn publication_keys(&self) -> Vec<Guid>
Sammelt die GUIDs aller Publications (fuer Snapshot-Tests / Diagnose).
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