Skip to main content

qubit_http/sse/
sse_json_mode.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2025 - 2026.
4 *    Haixing Hu, Qubit Co. Ltd.
5 *
6 *    All rights reserved.
7 *
8 ******************************************************************************/
9//! Strictness for JSON parsing on SSE `data:` lines.
10//!
11//! # Author
12//!
13//! Haixing Hu
14
15/// How to handle JSON parse failures on SSE `data:` lines.
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub enum SseJsonMode {
18    /// Skip bad chunks and continue.
19    Lenient,
20    /// Propagate [`crate::HttpError::sse_decode`] on first failure.
21    Strict,
22}