Registry / networking / eventsource-stream

eventsource-stream

JSON →
library0.2.3rscratesunverified

A basic building block for building an EventSource from a Stream of bytes.

# Cargo.toml [dependencies] eventsource-stream = "0.2.3"
INSTALL
IMPORT
SIG · EVENTSOURCE-STREAM
E
eventsource-stream
networkingrustv0.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EventStream
use eventsource_stream::EventStream;

Parse an EventSource stream from bytes.

use eventsource_stream::EventStream; use futures::StreamExt; #[tokio::main] async fn main() { let stream = EventStream::new(/* some byte stream */); while let Some(event) = stream.next().await { println!("{:?}", event); } }
Debug
Known issues
gotchaRequires an async runtime like tokio or async-std.
fix
Add tokio or async-std as a dependency and use #[tokio::main] or similar.
affects: >=0.1.0
Upgrade
Version history
0.2.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
Resources
eventsource-stream — cargo add eventsource-stream · libregistry