Trait SseConnExt

Source
pub trait SseConnExt {
    // Required method
    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§

Source

fn with_sse_stream<S, E>(self, sse_stream: S) -> Self
where 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SseConnExt for Conn

Source§

fn with_sse_stream<S, E>(self, sse_stream: S) -> Self
where S: Stream<Item = E> + Unpin + Send + Sync + 'static, E: Eventable,

Implementors§