Skip to main content

InteractionChannel

Trait InteractionChannel 

Source
pub trait InteractionChannel: Send + Sync {
    // Required methods
    fn request_consent<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: ApprovalRequest,
        cancel: &'life1 CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<ApprovalDecision, InteractionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn ask_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        question: &'life1 str,
        options: &'life2 [AskOption],
        cancel: &'life3 CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<AskAnswer, InteractionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Product-layer interaction surface hung off ExecCtx (OV-6): consent and ask_user suspend the executing action and wait for the product to answer. Routed through the host’s single throat — the same seam policy and journal already use. cancel is the run’s one token (interrupt / timeout / watchdog); implementations must release promptly on it.

Required Methods§

Consent / approval request; suspends until the product layer answers.

Source

fn ask_user<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, question: &'life1 str, options: &'life2 [AskOption], cancel: &'life3 CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<AskAnswer, InteractionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Ask the user to pick between candidates; suspends until answered. A skip is an answer too (AskAnswer::Skipped) — never re-ask.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§