pub trait AsyncEngineStream<T: Data>:
Stream<Item = T>
+ AsyncEngineContextProvider
+ Send { }Expand description
A streaming asynchronous engine operation.
This trait combines Stream semantics with context provider capabilities,
representing a continuous async operation that produces multiple messages over time.
The canonical boxed form is EngineStream<T> (= crate::pipeline::ManyOut<T>),
the stream of response chunks an engine emits; ResponseStream is the
canonical concrete implementor.
Trait Implementations§
Source§impl<T, U> AsyncEngine<Context<AddressedRequest<T>>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for AddressedPushRouter
impl<T, U> AsyncEngine<Context<AddressedRequest<T>>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for AddressedPushRouter
Source§impl<T, U> AsyncEngine<Context<RequestStream<T>>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for PushRouter<T, U>
Bidirectional AsyncEngine impl for streaming-input workloads (e.g. the
OpenAI Realtime API). Reserves a sticky worker up front — before any
inbound frame is observed — and binds the whole input stream to that
worker. KV and Direct modes inherit the same bail! invariants as the
unary impl.
impl<T, U> AsyncEngine<Context<RequestStream<T>>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for PushRouter<T, U>
Bidirectional AsyncEngine impl for streaming-input workloads (e.g. the
OpenAI Realtime API). Reserves a sticky worker up front — before any
inbound frame is observed — and binds the whole input stream to that
worker. KV and Direct modes inherit the same bail! invariants as the
unary impl.
Reserve-before-observe rationale. The router-mode strategies
(RoundRobin, Random, PowerOfTwoChoices, LeastLoaded,
DeviceAwareWeighted) don’t depend on frame contents, so selection
runs immediately and connection setup proceeds in parallel with the
client producing its first frame. A client that connects but never
sends one still releases the slot via the response-stream-drop path;
the dispatch-side cancel_both cleanup covers the early-bail case.
Source§impl<T, U> AsyncEngine<Context<T>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for PushRouter<T, U>
impl<T, U> AsyncEngine<Context<T>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for PushRouter<T, U>
Source§impl<T, U> AsyncEngine<Context<T>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for Egress<SingleIn<T>, ManyOut<U>>
impl<T, U> AsyncEngine<Context<T>, Pin<Box<dyn AsyncEngineStream<U, Item = U>>>, Error> for Egress<SingleIn<T>, ManyOut<U>>
Source§impl<T: Data> AsyncEngineContextProvider for Pin<Box<dyn AsyncEngineStream<T>>>
impl<T: Data> AsyncEngineContextProvider for Pin<Box<dyn AsyncEngineStream<T>>>
Source§impl<T: Data> From<Pin<Box<dyn AsyncEngineStream<T, Item = T>>>> for DataStream<T>
impl<T: Data> From<Pin<Box<dyn AsyncEngineStream<T, Item = T>>>> for DataStream<T>
Source§fn from(stream: EngineStream<T>) -> Self
fn from(stream: EngineStream<T>) -> Self
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".