pub trait PubSubProvider {
type Channels;
// Required methods
fn subscribe(
&self,
callback: AsyncCallback<ChannelMessage>,
channel: Self::Channels,
) -> Pin<Box<dyn Future<Output = Result<(), &'static str>> + Send + '_>>;
fn publish(&mut self, channel: Self::Channels, message: ChannelMessage);
}Required Associated Types§
Required Methods§
fn subscribe( &self, callback: AsyncCallback<ChannelMessage>, channel: Self::Channels, ) -> Pin<Box<dyn Future<Output = Result<(), &'static str>> + Send + '_>>
fn publish(&mut self, channel: Self::Channels, message: ChannelMessage)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".