MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / drop_topic

Method drop_topic

nodedb/src/control/pubsub.rs:160–168  ·  view source on GitHub ↗

Drop a topic and all its messages.

(&self, name: &str)

Source from the content-addressed store, hash-verified

158
159 /// Drop a topic and all its messages.
160 pub fn drop_topic(&self, name: &str) -> Result<(), TopicError> {
161 let mut topics = super::lock_utils::write_or_recover(self.topics.write(), "topics");
162 if topics.remove(name).is_some() {
163 debug!(topic = name, "topic dropped");
164 Ok(())
165 } else {
166 Err(TopicError::NotFound(name.to_string()))
167 }
168 }
169
170 /// List all topic names.
171 pub fn list_topics(&self) -> Vec<String> {

Callers 1

drop_topicFunction · 0.80

Calls 4

write_or_recoverFunction · 0.85
to_stringMethod · 0.80
writeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected