Skip to main content

SseExt

Trait SseExt 

Source
pub trait SseExt<B>
where B: Body<Data = Bytes> + Unpin, B::Error: Into<BoxError>,
{ // Required method fn into_sse(self) -> Result<SseReader<B>, BoxError>; }
Available on crate feature client only.
Expand description

Extension trait adding SseExt::into_sse to Response.

Required Methods§

Source

fn into_sse(self) -> Result<SseReader<B>, BoxError>

Consume the response and return an SseReader.

Returns an error if the Content-Type is not text/event-stream.

Implementors§

Source§

impl<B> SseExt<B> for Response<B>
where B: Body<Data = Bytes> + Unpin, B::Error: Into<BoxError>,