From ca21acf52581fbbc44ef9cc67619a3f0623d280a Mon Sep 17 00:00:00 2001 From: Ladle <77344665+The-Ladle@users.noreply.github.com> Date: Fri, 11 Jul 2025 15:04:07 -0400 Subject: [PATCH] Add .child() function to allow topic to act as prefix --- src/topic.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/topic.rs b/src/topic.rs index 41706d3..6c90734 100644 --- a/src/topic.rs +++ b/src/topic.rs @@ -109,6 +109,11 @@ impl Topic { &mut self.name } + /// Creates a child topic + pub fn child(&self, name: &str) -> Self{ + Self::new(self.name.clone() + name, self.handle.clone()) + } + /// Publishes to this topic with the data type `T`. /// /// For a generic-free version, see [`generic_publish`][`Self::generic_publish`].