pub trait Channel: Send + Sync {
// Required methods
fn platform(&self) -> Platform;
fn send<'life0, 'async_trait>(
&'life0 self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn receive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IncomingMessage>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for messaging platform integrations (WebChat, Telegram, Discord, etc.).
Required Methods§
Sourcefn send<'life0, 'async_trait>(
&'life0 self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a message through this channel.
Sourcefn receive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IncomingMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IncomingMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive the next incoming message (blocks until available).