Skip to main content

ModelStream

Trait ModelStream 

Source
pub trait ModelStream: Send {
    // Required method
    fn next_event<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<Result<StreamEvent, String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A stream of provider events opened by ModelExecutor::open_stream.

It mirrors salvor_llm::MessageStream: pull one typed event at a time until None. The server feeds each event to a [MessageAccumulator] so the recorded completion is byte-identical to the non-streaming path.

Required Methods§

Source

fn next_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<Result<StreamEvent, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The next provider event, or None once the stream is exhausted. An Err(String) is a mid-stream failure: the server surfaces it and records no completion, leaving the intent dangling for a safe re-issue on resume.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§