Trait trillium_sse::SseConnExt
source · [−]pub trait SseConnExt {
fn with_sse_stream<S, E>(self, sse_stream: S) -> Self
where
S: Stream<Item = E> + Unpin + Send + Sync + 'static,
E: Eventable;
}
Expand description
Extension trait for server sent events
Required Methods
sourcefn with_sse_stream<S, E>(self, sse_stream: S) -> Selfwhere
S: Stream<Item = E> + Unpin + Send + Sync + 'static,
E: Eventable,
fn with_sse_stream<S, E>(self, sse_stream: S) -> Selfwhere
S: Stream<Item = E> + Unpin + Send + Sync + 'static,
E: Eventable,
builds and sets a streaming response body that conforms to the
server-sent-events
spec
from a Stream of any Eventable
type (such as
Event
, as well as setting appropiate headers for
this response.