Module codec

Module codec 

Source
Expand description

A module for parsing Server-Sent Events (SSE) streams according to the SSE specification.

This module provides SseLineCodec<T>, a codec for decoding SSE streams into typed messages. It handles parsing of id, event, data, and comments, and attempts to deserialize the data field into the specified type T.

Structs§

Message
Represents a parsed SSE message.
SseLineCodec
A codec for decoding SSE streams into Message<T> instances.

Enums§

SseCodecError
An error that occurs when decoding an SSE stream.

Functions§

create_message_stream
Creates a stream of Message instances from a text stream of SSE events.