Skip to main content

CopilotWebSocketHandler

Trait CopilotWebSocketHandler 

Source
pub trait CopilotWebSocketHandler: Send + Sync {
    // Required methods
    fn send_request_message<'life0, 'async_trait>(
        &'life0 self,
        message: CopilotWebSocketMessage,
    ) -> Pin<Box<dyn Future<Output = Result<(), CopilotRequestError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), CopilotRequestError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A per-connection WebSocket handler. The default implementation (CopilotWebSocketForwarder) bridges to the real upstream; override CopilotRequestHandler::open_websocket to supply a custom one.

Required Methods§

Source

fn send_request_message<'life0, 'async_trait>( &'life0 self, message: CopilotWebSocketMessage, ) -> Pin<Box<dyn Future<Output = Result<(), CopilotRequestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Forward one runtime→upstream message.

Source

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

Tear down the upstream connection.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§