pub trait Subscribable {
// Required methods
fn subscribe<T: ActonMessage + Send + Sync + 'static>(
&self,
) -> impl Future<Output = ()> + Send + Sync + '_
where Self: Actor + Subscriber;
fn unsubscribe<T: ActonMessage>(&self)
where Self: Actor + Subscriber + Send + Sync + 'static;
}Expand description
Trait for types that can subscribe to and unsubscribe from messages.
Required Methods§
Sourcefn subscribe<T: ActonMessage + Send + Sync + 'static>(
&self,
) -> impl Future<Output = ()> + Send + Sync + '_where
Self: Actor + Subscriber,
fn subscribe<T: ActonMessage + Send + Sync + 'static>(
&self,
) -> impl Future<Output = ()> + Send + Sync + '_where
Self: Actor + Subscriber,
Sourcefn unsubscribe<T: ActonMessage>(&self)
fn unsubscribe<T: ActonMessage>(&self)
Unsubscribes the implementing type from messages of type T.
§Type Parameters
T: The type of message to unsubscribe from. Must implementActonMessage.
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.
Implementors§
impl<T> Subscribable for T
Implementation of Subscribable for any type that implements ActonMessage + Send + Sync + 'static.