Skip to main content

decode_events

Function decode_events 

Source
pub fn decode_events<S, B, E>(chunks: S) -> impl Stream<Item = Result<Event>>
where S: Stream<Item = Result<B, E>>, B: AsRef<[u8]>, E: Error + Send + Sync + 'static,
Expand description

Decodes a stream of byte chunks into a stream of events.

This is the adapter between a transport’s body stream and the rest of the crate. Errors from the byte stream become Error::Transport items and end the stream; a frame whose payload is not a valid event becomes an error item and the stream continues, because one malformed event should not silence the rest of the run.