1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Reusable, side-effect-free HTTP/streaming parsing and wire-format helpers.
//!
//! This is a leaf parsing crate: it contains URL parsing, HTTP response-head
//! parsing, body-mode classification, chunked-transfer decoding, line framing,
//! and SSE/NDJSON record decoders, plus small text encoders for shared wire
//! identifiers. It deliberately contains **no** socket/TLS I/O and **no**
//! application policy -- callers own transport and event mapping.
//!
//! The behavior here was extracted from `sim-lib-agent-runner-http` so that
//! multiple runtime libs can share one tested implementation of the wire
//! framing rather than each hand-rolling line accumulation and head parsing.
//!
//! # Example
//!
//! `LineDecoder` frames newline-delimited input, buffering a partial final line
//! across pushes:
//!
//! ```
//! use sim_lib_net_core::LineDecoder;
//!
//! let mut decoder = LineDecoder::new();
//! assert_eq!(decoder.push(b"a\nb"), vec![b"a".to_vec()]);
//! assert_eq!(decoder.push(b"c\n"), vec![b"bc".to_vec()]);
//! ```
pub use decode_chunked;
pub use NetError;
pub use hex_encode;
pub use ;
pub use LineDecoder;
pub use NdjsonDecoder;
pub use ;
pub use ;
pub use ;
/// Cookbook recipes for this lib, embedded at build time.
pub static RECIPES: EmbeddedDir =
include!;