pub trait Channel: Send + Sync {
Show 13 methods
// Required methods
fn name(&self) -> &str;
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn listen<'life0, 'async_trait>(
&'life0 self,
tx: Sender<ChannelMessage>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn start_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn stop_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn supports_draft_updates(&self) -> bool { ... }
fn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn update_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn finalize_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn cancel_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn add_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn remove_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
Core channel trait — implement for any messaging platform.