create_sse_stream

Function create_sse_stream 

Source
pub fn create_sse_stream<T>(
    events: Vec<T>,
    formatter: impl Fn(&T) -> String + Send + 'static,
) -> impl Stream<Item = Result<Bytes>> + Send + 'static
where T: Send + 'static,
Expand description

Create a stream of SSE events from a vector of data

Utility function for testing and simple use cases where you have a known set of events to stream.