Skip to main content

PlatformAdapter

Trait PlatformAdapter 

Source
pub trait PlatformAdapter:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn start<'life0, 'async_trait>(
        &'life0 self,
        handler: Arc<dyn MessageHandler>,
    ) -> Pin<Box<dyn Future<Output = Result<(), PlatformError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        channel: &'life1 ChannelId,
        message: OutboundMessage,
    ) -> Pin<Box<dyn Future<Output = Result<(), PlatformError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send_stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        channel: &'life1 ChannelId,
        stream: Pin<Box<dyn Stream<Item = String> + Send>>,
    ) -> Pin<Box<dyn Future<Output = Result<(), PlatformError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

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

Source

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

Source

fn send_stream<'life0, 'life1, 'async_trait>( &'life0 self, channel: &'life1 ChannelId, stream: Pin<Box<dyn Stream<Item = String> + Send>>, ) -> Pin<Box<dyn Future<Output = Result<(), PlatformError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§