Skip to main content

ChatBackend

Trait ChatBackend 

Source
pub trait ChatBackend: Send + Sync {
    // Required method
    fn complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        req: &'life1 ChatRequest,
        events: &'life2 EventSink,
        cancel: &'life3 CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Marker trait tie-in kept minimal for Phase 2; the API worker adapter wraps this client and implements Worker.

Required Methods§

Source

fn complete<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, req: &'life1 ChatRequest, events: &'life2 EventSink, cancel: &'life3 CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§