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§
Sourcefn 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,
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§
Sourcefn 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 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.
Sourcefn 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,
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".