pub trait StreamingHandler: Send + Sync {
// Required methods
fn handle_stream<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
sender: Box<dyn StreamSender>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stream_config(&self) -> &StreamConfig;
}Expand description
Streaming response handler
Required Methods§
Sourcefn handle_stream<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
sender: Box<dyn StreamSender>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_stream<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
sender: Box<dyn StreamSender>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle streaming inference request
Sourcefn stream_config(&self) -> &StreamConfig
fn stream_config(&self) -> &StreamConfig
Get streaming configuration
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".