Drop a topic and all its messages.
(&self, name: &str)
| 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> { |
no test coverage detected