pub trait SubscriptionTopic {
// Required method
fn subscription_topic<A>(
&self,
agent_id: &A,
me_version: &str,
) -> Result<String, Error>
where A: Addressable;
}
Required Methods§
Sourcefn 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")?;
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.