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§
fn id(&self) -> ChannelId
fn capabilities(&self) -> ChannelCapabilities
fn listen(&self) -> Result<ChannelStream, ChannelError>
fn send(&self, message: OutboundMessage) -> ChannelFuture<'_, DeliveryReceipt>
Provided Methods§
fn health(&self) -> ChannelFuture<'_, ChannelHealth>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".