pub struct TopicRegistry { /* private fields */ }Expand description
Central registry for tracking topics at runtime
Thread-safe registry that maintains information about all active topics, their publishers, and subscribers.
Implementations§
Source§impl TopicRegistry
impl TopicRegistry
Sourcepub async fn register_publisher(
&self,
topic: &str,
node_id: &str,
message_type: &str,
)
pub async fn register_publisher( &self, topic: &str, node_id: &str, message_type: &str, )
Register a publisher for a topic
§Arguments
topic- Topic pathnode_id- Publishing node identifiermessage_type- Message type name
Sourcepub async fn register_subscriber(
&self,
topic: &str,
node_id: &str,
message_type: &str,
)
pub async fn register_subscriber( &self, topic: &str, node_id: &str, message_type: &str, )
Register a subscriber for a topic
§Arguments
topic- Topic pathnode_id- Subscribing node identifiermessage_type- Message type name
Sourcepub async fn unregister_publisher(&self, topic: &str, node_id: &str)
pub async fn unregister_publisher(&self, topic: &str, node_id: &str)
Unregister a publisher
Sourcepub async fn unregister_subscriber(&self, topic: &str, node_id: &str)
pub async fn unregister_subscriber(&self, topic: &str, node_id: &str)
Unregister a subscriber
Sourcepub async fn unregister_node(&self, node_id: &str)
pub async fn unregister_node(&self, node_id: &str)
Unregister all topics for a node (when node stops)
Sourcepub async fn get_topic(&self, topic: &str) -> Option<TopicInfo>
pub async fn get_topic(&self, topic: &str) -> Option<TopicInfo>
Get information about a specific topic
Sourcepub async fn list_topics(&self) -> Vec<String>
pub async fn list_topics(&self) -> Vec<String>
List all registered topics
Sourcepub async fn get_all_topics(&self) -> Vec<TopicInfo>
pub async fn get_all_topics(&self) -> Vec<TopicInfo>
Get all topic information
Sourcepub async fn find_by_message_type(&self, message_type: &str) -> Vec<TopicInfo>
pub async fn find_by_message_type(&self, message_type: &str) -> Vec<TopicInfo>
Find topics by message type
Sourcepub async fn topics_published_by(&self, node_id: &str) -> Vec<String>
pub async fn topics_published_by(&self, node_id: &str) -> Vec<String>
Find topics published by a node
Sourcepub async fn topics_subscribed_by(&self, node_id: &str) -> Vec<String>
pub async fn topics_subscribed_by(&self, node_id: &str) -> Vec<String>
Find topics subscribed to by a node
Sourcepub async fn topic_count(&self) -> usize
pub async fn topic_count(&self) -> usize
Get total number of topics
Sourcepub async fn validate(&self) -> Vec<String>
pub async fn validate(&self) -> Vec<String>
Validate the topic topology
Returns a list of validation issues:
- Topics with no publishers
- Topics with no subscribers
- Type mismatches
Sourcepub async fn stats(&self) -> TopologyStats
pub async fn stats(&self) -> TopologyStats
Get topology statistics
Sourcepub async fn export_dot(&self) -> String
pub async fn export_dot(&self) -> String
Export topology as DOT graph (for Graphviz visualization)
Trait Implementations§
Source§impl Clone for TopicRegistry
impl Clone for TopicRegistry
Source§fn clone(&self) -> TopicRegistry
fn clone(&self) -> TopicRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TopicRegistry
impl !RefUnwindSafe for TopicRegistry
impl Send for TopicRegistry
impl Sync for TopicRegistry
impl Unpin for TopicRegistry
impl !UnwindSafe for TopicRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more