pub trait StreamingProtocolExecutor {
type PreparedData: Clone + Debug + Send + Sync;
// Required method
fn execute_stream(
&mut self,
data: &Self::PreparedData,
context: &ExecutionContext,
sender: Sender<StreamChunk>,
) -> impl Future<Output = Result<StreamMeta>> + Send;
}Expand description
Contract for protocol executors that support streaming output.
Instead of buffering the full response, the executor sends individual
chunks through the provided mpsc::Sender as they arrive.
Required Associated Types§
Required Methods§
Sourcefn execute_stream(
&mut self,
data: &Self::PreparedData,
context: &ExecutionContext,
sender: Sender<StreamChunk>,
) -> impl Future<Output = Result<StreamMeta>> + Send
fn execute_stream( &mut self, data: &Self::PreparedData, context: &ExecutionContext, sender: Sender<StreamChunk>, ) -> impl Future<Output = Result<StreamMeta>> + Send
Execute a streaming request, sending chunks through sender.
Returns metadata about the completed stream.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".