Skip to main content

PubSubProvider

Trait PubSubProvider 

Source
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§

Source

fn subscribe( &self, callback: AsyncCallback<ChannelMessage>, channel: Self::Channels, ) -> Pin<Box<dyn Future<Output = Result<(), &'static str>> + Send + '_>>

Source

fn publish(&mut self, channel: Self::Channels, message: ChannelMessage)

Implementors§