1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Transport-agnostic SSE protocol parsing and stream adaptation.
//!
//! This crate exposes only normalized events, protocol frames, and stream adapters.
//! Raw line parsing and event-building state remain internal implementation details.
//!
//! # Event-Only Consumption
//!
//! ```no_run
//! use std::convert::Infallible;
//!
//! use bytes::Bytes;
//! use eventsrc::EventStream;
//! use futures_util::{StreamExt, stream};
//!
//! # async fn demo() -> Result<(), eventsrc::StreamError<Infallible>> {
//! let chunks = stream::iter([Ok::<Bytes, Infallible>(Bytes::from_static(b"data: hello\n\n"))]);
//! let mut stream = EventStream::new(chunks);
//!
//! let event = stream.next().await.unwrap()?;
//! assert_eq!(event.event(), "message");
//! assert_eq!(event.data(), "hello");
//! assert_eq!(event.id(), "");
//! # Ok(())
//! # }
//! ```
extern crate alloc;
extern crate std;
pub use ;
pub use ;
pub use ;