#event-source #events #sse #stream

no-std eventsource-stream

A basic building block for building an Eventsource from a Stream of bytes

7 releases

0.2.3 Feb 17, 2022
0.2.2 Feb 11, 2022
0.2.1 Jan 31, 2022
0.1.2 Oct 21, 2021
0.1.1 Jun 28, 2020

#7 in #event-source

Download history 65391/week @ 2026-03-03 455898/week @ 2026-03-10 353559/week @ 2026-03-17 285777/week @ 2026-03-24 289299/week @ 2026-03-31 311959/week @ 2026-04-07 321068/week @ 2026-04-14 348895/week @ 2026-04-21 372967/week @ 2026-04-28 324245/week @ 2026-05-05 382717/week @ 2026-05-12 458411/week @ 2026-05-19 470146/week @ 2026-05-26 391893/week @ 2026-06-02

1,753,255 downloads per month
Used in 1,366 crates (245 directly)

MIT/Apache

31KB
770 lines

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

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


while let Some(event) = stream.next().await {
    match event {
        Ok(event) => println!(
            "received event[type={}]: {}",
            event.event,
            event.data
        ),
        Err(e) => eprintln!("error occured: {}", e),
    }
}

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

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);
}

License: MIT OR Apache-2.0

Dependencies

~270–445KB