Skip to main content

DiscoveredEndpointsCache

Struct DiscoveredEndpointsCache 

Source
pub struct DiscoveredEndpointsCache { /* private fields */ }
Expand description

In-memory Cache fuer SEDP-entdeckte Endpoints.

Implementations§

Source§

impl DiscoveredEndpointsCache

Source

pub fn new(caps: CacheCaps) -> Self

Neu mit den gegebenen Caps.

Source

pub fn publications_len(&self) -> usize

Anzahl Publications insgesamt.

Source

pub fn subscriptions_len(&self) -> usize

Anzahl Subscriptions insgesamt.

Source

pub fn evicted_count(&self) -> u64

Anzahl LRU-Evictions seit Start (DoS-Diagnose).

Source

pub fn publication(&self, key: Guid) -> Option<&DiscoveredPublication>

Lookup einer Publication per Endpoint-GUID.

Source

pub fn subscription(&self, key: Guid) -> Option<&DiscoveredSubscription>

Lookup einer Subscription per Endpoint-GUID.

Source

pub fn publications_for( &self, prefix: GuidPrefix, ) -> impl Iterator<Item = &DiscoveredPublication> + '_

Iteriert alle Publications eines Remote-Participants.

Source

pub fn subscriptions_for( &self, prefix: GuidPrefix, ) -> impl Iterator<Item = &DiscoveredSubscription> + '_

Iteriert alle Subscriptions eines Remote-Participants.

Source

pub fn publications(&self) -> impl Iterator<Item = &DiscoveredPublication> + '_

Iteriert alle Publications (fuer Matching-Scan).

Source

pub fn subscriptions( &self, ) -> impl Iterator<Item = &DiscoveredSubscription> + '_

Iteriert alle Subscriptions.

Source

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.

Source

pub fn insert_subscription( &mut self, data: SubscriptionBuiltinTopicData, now: Duration, ) -> bool

Insert oder Update einer Subscription. Semantik analog Self::insert_publication.

Source

pub fn remove_publication(&mut self, key: Guid) -> Option<DiscoveredPublication>

Entfernt eine Publication per GUID (z.B. nach expliziter Withdrawal-Notification vom Remote).

Source

pub fn remove_subscription( &mut self, key: Guid, ) -> Option<DiscoveredSubscription>

Entfernt eine Subscription per GUID.

Source

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

Source

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

Source

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.

Source

pub fn publication_keys(&self) -> Vec<Guid>

Sammelt die GUIDs aller Publications (fuer Snapshot-Tests / Diagnose).

Trait Implementations§

Source§

impl Clone for DiscoveredEndpointsCache

Source§

fn clone(&self) -> DiscoveredEndpointsCache

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 DiscoveredEndpointsCache

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DiscoveredEndpointsCache

Source§

fn default() -> DiscoveredEndpointsCache

Returns the “default value” for a type. 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.