Skip to main content

ChannelAdapter

Trait ChannelAdapter 

Source
pub trait ChannelAdapter: ChannelSink {
    // Required methods
    fn wire<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn typed<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        account: &'life1 str,
        thread: &'life2 str,
        text: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = ChannelInbound> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn pressed<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        account: &'life1 str,
        thread: &'life2 str,
        answer: ChannelAnswer,
    ) -> Pin<Box<dyn Future<Output = Option<ChannelInbound>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn pairing_code<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A chat adapter as the suite drives it (spec 3.3 §10 K1): its ChannelSink, what it put on the wire, and the ChannelInbound values it makes of the person’s input.

Required Methods§

Source

fn wire<'life0, 'life1, 'async_trait>( &'life0 self, thread: &'life1 str, ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Everything the adapter put on the wire to thread, in order, as text: what left the machine.

Source

fn typed<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, account: &'life1 str, thread: &'life2 str, text: &'life3 str, ) -> Pin<Box<dyn Future<Output = ChannelInbound> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

What the adapter makes of account typing text in thread, as a new message.

Source

fn pressed<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, account: &'life1 str, thread: &'life2 str, answer: ChannelAnswer, ) -> Pin<Box<dyn Future<Output = Option<ChannelInbound>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

What the adapter makes of account pressing answer on the last card it sent to thread, or None when that card offers no such button.

Source

fn pairing_code<'life0, 'life1, 'async_trait>( &'life0 self, thread: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The pairing code the adapter delivered to thread, as the person reads it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§