Skip to main content

PromptMiddleware

Trait PromptMiddleware 

Source
pub trait PromptMiddleware: Send + Sync {
    // Required method
    fn inspect<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        call: &'life1 PromptCall<'life2>,
    ) -> Pin<Box<dyn Future<Output = PromptDecision> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn inspect_with_attachments<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        call: &'life1 PromptCall<'life2>,
        attachments: &'life3 [PromptAttachment<'life4>],
    ) -> Pin<Box<dyn Future<Output = PromptDecision> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
}

Required Methods§

Source

fn inspect<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, call: &'life1 PromptCall<'life2>, ) -> Pin<Box<dyn Future<Output = PromptDecision> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn inspect_with_attachments<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, call: &'life1 PromptCall<'life2>, attachments: &'life3 [PromptAttachment<'life4>], ) -> Pin<Box<dyn Future<Output = PromptDecision> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

What the runtime calls. Attachments can’t be rewritten: a Rewrite replaces the text only, a Block refuses the whole message.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§