[][src]Crate eventsource_stream

A basic building block for building an Eventsource from a Stream of bytes array like objects. To learn more about Server Sent Events (SSE) take a look at the MDN docs

Example

This example is not tested
let mut stream = reqwest::Client::new()
    .get("http://localhost:7020/notifications")
    .send()
    .await?
    .bytes_stream()
    .eventsource();

while let Some(thing) = stream.next().await {
   println!("{:?}", thing);
}

Structs

Event

An Event

EventStreamTransformer

Provides the Stream implementation for Events

Enums

Error

Wrapper for ParseError and other Transport Errors thrown while collecting the Event stream

ParseError

Error thrown while parsing an event line

Traits

Eventsource

Main entrypoint for creating Event streams