Skip to main content

InboundSink

Trait InboundSink 

Source
pub trait InboundSink: Send + Sync {
    // Required method
    fn deliver<'life0, 'async_trait>(
        &'life0 self,
        event: InboundEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), SinkClosed>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn answer<'life0, 'async_trait>(
        &'life0 self,
        _answer: PromptAnswer,
    ) -> Pin<Box<dyn Future<Output = Result<(), SinkClosed>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn prompt<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _id: &'life1 str,
        _conversation: &'life2 ConversationKey,
    ) -> Pin<Box<dyn Future<Output = Option<Prompt>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Receives normalized events from channels. Implemented by the runtime.

Required Methods§

Source

fn deliver<'life0, 'async_trait>( &'life0 self, event: InboundEvent, ) -> Pin<Box<dyn Future<Output = Result<(), SinkClosed>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Hands one event to the runtime. Returns quickly; processing happens elsewhere.

Provided Methods§

Source

fn answer<'life0, 'async_trait>( &'life0 self, _answer: PromptAnswer, ) -> Pin<Box<dyn Future<Output = Result<(), SinkClosed>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Hands over the answer to a Prompt. Returns quickly. Sinks without prompts ignore it.

Source

fn prompt<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _id: &'life1 str, _conversation: &'life2 ConversationKey, ) -> Pin<Box<dyn Future<Output = Option<Prompt>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

A prompt the runtime still waits on in conversation (its channel and room), for channels that no longer hold it (they restarted since showing it). Interactive replies (ADR 0015) outlive restarts; other prompts do not.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§