ssevents/decoder

Full-body and incremental SSE decoding.

Semantics chosen for the initial release:

Types

pub opaque type DecodeState

Values

pub fn decode(
  input: String,
) -> Result(List(event.Item), error.SseError)
pub fn decode_bytes(
  input: BitArray,
) -> Result(List(event.Item), error.SseError)
pub fn decode_bytes_with_limits(
  input: BitArray,
  limits limits: limit.Limits,
) -> Result(List(event.Item), error.SseError)
pub fn decode_with_limits(
  input: String,
  limits limits: limit.Limits,
) -> Result(List(event.Item), error.SseError)
pub fn finish(
  state: DecodeState,
) -> Result(List(event.Item), error.SseError)
pub fn new_decoder() -> DecodeState
pub fn new_decoder_with_limits(
  limits: limit.Limits,
) -> DecodeState
pub fn push(
  state: DecodeState,
  chunk: BitArray,
) -> Result(#(DecodeState, List(event.Item)), error.SseError)
Search Document