Skip to main content

ChannelAdapter

Trait ChannelAdapter 

Source
pub trait ChannelAdapter: Send + Sync {
    // Required methods
    fn id(&self) -> ChannelId;
    fn capabilities(&self) -> ChannelCapabilities;
    fn listen(&self) -> Result<ChannelStream, ChannelError>;
    fn send(
        &self,
        message: OutboundMessage,
    ) -> ChannelFuture<'_, DeliveryReceipt>;

    // Provided method
    fn health(&self) -> ChannelFuture<'_, ChannelHealth> { ... }
}
Expand description

Object-safe contract implemented by Telegram, Slack, Discord, or custom adapters.

Required Methods§

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§