use crate::error::Result;
use crate::transport;
pub struct Subscriber {
topic: String,
inner: Box<dyn transport::Subscriber>,
}
impl Subscriber {
pub(crate) fn new(topic: String, inner: Box<dyn transport::Subscriber>) -> Self {
Self { topic, inner }
}
pub fn topic(&self) -> &str {
&self.topic
}
pub fn close(&self) -> Result<()> {
self.inner.close()
}
}