Skip to main content

qubit_http/sse/
sse_chunk.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2025 - 2026.
4 *    Haixing Hu, Qubit Co. Ltd.
5 *
6 *    All rights reserved.
7 *
8 ******************************************************************************/
9//! Decoded JSON chunk or explicit SSE stream end marker.
10//!
11//! # Author
12//!
13//! Haixing Hu
14
15/// Either a decoded JSON value from one SSE data payload or an explicit end marker.
16#[derive(Debug, Clone, PartialEq)]
17pub enum SseChunk<T> {
18    /// Successfully deserialized JSON object.
19    Data(T),
20    /// Synthetic item emitted when [`DoneMarkerPolicy`](crate::sse::DoneMarkerPolicy)
21    /// matches (then stream ends).
22    Done,
23}