pub trait ChannelAdapter: Send + Sync {
// Required methods
fn provider_name(&self) -> &str;
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CiabResult<Receiver<InboundMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient_id: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = CiabResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn state(&self) -> ChannelState;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CiabResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn qr_code(&self) -> Option<String> { ... }
}Expand description
Adapter trait for messaging platform integrations.
Required Methods§
Sourcefn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Human-readable provider name (e.g. “whatsapp”, “slack”, “webhook”).
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CiabResult<Receiver<InboundMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CiabResult<Receiver<InboundMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the adapter and return a receiver for inbound messages.
Sourcefn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient_id: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = CiabResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient_id: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = CiabResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a message back to the platform.
Sourcefn state(&self) -> ChannelState
fn state(&self) -> ChannelState
Current adapter state.