Trait CrossTabChannel

Source
pub trait CrossTabChannel: Send + Sync {
    // Required methods
    fn send_message<'life0, 'async_trait>(
        &'life0 self,
        message: CrossTabMessage,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_message(&self, callback: Box<dyn Fn(CrossTabMessage) + Send + Sync>);
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Cross-tab communication channel

Required Methods§

Source

fn send_message<'life0, 'async_trait>( &'life0 self, message: CrossTabMessage, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a message to other tabs

Source

fn on_message(&self, callback: Box<dyn Fn(CrossTabMessage) + Send + Sync>)

Register a message listener

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the channel

Implementors§