Trait svc_agent::mqtt::SubscriptionTopic [−][src]
pub trait SubscriptionTopic {
fn subscription_topic<A>(
&self,
agent_id: &A,
me_version: &str
) -> Result<String, Error>
where
A: Addressable;
}Required methods
fn subscription_topic<A>(
&self,
agent_id: &A,
me_version: &str
) -> Result<String, Error> where
A: Addressable,
fn subscription_topic<A>(
&self,
agent_id: &A,
me_version: &str
) -> Result<String, Error> where
A: Addressable,
Returns a topic to subscribe to as string.
Arguments
agent_id– current agent’s AgentId.me_version– current agent’s API version.
Example
let me = AgentId::new("instance01", AccountId::new("me_name", "svc.example.org"));
let agent = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org"));
let subscription = Subscription::broadcast_events(&agent, "v1", "rooms/123/events");
let topic = subscription.subscription_topic(me, "v1")?;