pub trait Subscriptionwhere
Self: PartialEq,{
type Event: Message;
// Required methods
fn subscribed_to(&self, message: &Self::Event) -> bool;
fn discriminant_set(&self) -> &[<Self::Event as Message>::Discriminant];
fn send_event(
&self,
message: Self::Event,
) -> Result<(), SendError<Self::Event>>;
}Expand description
A trait describin a bus subscription
Required Associated Types§
Required Methods§
Sourcefn subscribed_to(&self, message: &Self::Event) -> bool
fn subscribed_to(&self, message: &Self::Event) -> bool
Test whether this subscriiption is subscribed to a message
Sourcefn discriminant_set(&self) -> &[<Self::Event as Message>::Discriminant]
fn discriminant_set(&self) -> &[<Self::Event as Message>::Discriminant]
Returns a slice of discriminants corresponding to messages this subsccription is subscribed to
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.