pub trait ChannelBackend: Send + Sync {
Show 20 methods
// Required methods
fn connect_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
auth_mode: ChannelAuthMode,
credentials: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelConnectionResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn disconnect_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
auth_mode: ChannelAuthMode,
clear_memory: bool,
) -> Pin<Box<dyn Future<Output = Result<ChannelDisconnectResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn channel_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelStatusEntry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn test_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
auth_mode: ChannelAuthMode,
credentials: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelTestResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn send_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
message: SendMessage,
) -> Pin<Box<dyn Future<Output = Result<ChannelSendMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn send_reaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
reaction: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelReactionResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn create_thread<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
title: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<ChannelThreadResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn update_thread<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
thread_id: &'life3 str,
action: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<ChannelThreadResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn list_threads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
active: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<ChannelThreadListResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn telegram_login_start<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<TelegramLoginStartResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn telegram_login_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
link_token: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<TelegramLoginCheckResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn discord_link_start<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<DiscordLinkStartResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn discord_link_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
link_token: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<DiscordLinkCheckResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn discord_list_guilds<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<DiscordGuildListResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn discord_list_channels<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
guild_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<DiscordChannelListResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn discord_check_permissions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
guild_id: &'life2 str,
channel_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<DiscordPermissionCheckResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided methods
fn send_message_value<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_config: &'life1 ChannelsConfig,
_channel: &'life2 str,
_message: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelSendMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn send_outbound_intent<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
intent: ChannelOutboundIntent,
) -> Pin<Box<dyn Future<Output = Result<ChannelSendMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn set_default_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_config: &'life1 ChannelsConfig,
_channel: &'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 get_default_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Pluggable backend contract used by TinyChannels.
OpenHuman should implement this trait with its own REST/JWT/config storage layer. Tests and downstream embedders can provide in-memory implementations.
Required Methods§
fn connect_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
auth_mode: ChannelAuthMode,
credentials: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelConnectionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn disconnect_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
auth_mode: ChannelAuthMode,
clear_memory: bool,
) -> Pin<Box<dyn Future<Output = Result<ChannelDisconnectResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn channel_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelStatusEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn test_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
auth_mode: ChannelAuthMode,
credentials: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelTestResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
message: SendMessage,
) -> Pin<Box<dyn Future<Output = Result<ChannelSendMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_reaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
reaction: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelReactionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_thread<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
title: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<ChannelThreadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn update_thread<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
thread_id: &'life3 str,
action: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<ChannelThreadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn list_threads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
channel: &'life2 str,
active: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<ChannelThreadListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn telegram_login_start<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<TelegramLoginStartResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn telegram_login_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
link_token: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<TelegramLoginCheckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn discord_link_start<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<DiscordLinkStartResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn discord_link_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
link_token: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<DiscordLinkCheckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn discord_list_guilds<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<DiscordGuildListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn discord_list_channels<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
guild_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<DiscordChannelListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn discord_check_permissions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
guild_id: &'life2 str,
channel_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<DiscordPermissionCheckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Provided Methods§
fn send_message_value<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_config: &'life1 ChannelsConfig,
_channel: &'life2 str,
_message: Value,
) -> Pin<Box<dyn Future<Output = Result<ChannelSendMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_outbound_intent<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
intent: ChannelOutboundIntent,
) -> Pin<Box<dyn Future<Output = Result<ChannelSendMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_default_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_config: &'life1 ChannelsConfig,
_channel: &'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 get_default_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ChannelsConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".