Skip to main content

encode_model_event_sse_response

Function encode_model_event_sse_response 

Source
pub fn encode_model_event_sse_response<T, S>(items: S) -> Response<Body>
where T: Serialize + Send + 'static, S: Stream<Item = T> + Send + 'static,
Expand description

Encode items as a text/event-stream response. items ending (None from the underlying Stream) always means backpressure overflow closed the channel (see module docs) — the last byte chunk written is always the Error{unavailable} sentinel event.