rskit_codec/framing/mod.rs
1//! Bounded length-delimited framing for streaming structured-text payloads.
2//!
3//! A frame is a 4-byte big-endian unsigned length prefix followed by exactly
4//! that many payload bytes. Every read is bounded by an explicit maximum so a
5//! malformed or hostile peer can never make a reader allocate without limit.
6//! Use this to carry one [`Codec`](crate::Codec)-encoded value per frame over
7//! any blocking `Read`/`Write` transport (a pipe, a socket, a subprocess's
8//! stdio).
9//!
10//! [`write_value`] / [`read_value`] encode and decode typed values through an
11//! injected codec; [`write_frame`] / [`read_frame`] move raw payload bytes when
12//! the caller owns serialization.
13
14mod frame;
15mod value;
16
17pub use frame::{DEFAULT_MAX_FRAME_BYTES, read_frame, write_frame};
18pub use value::{decode_value, read_value, write_value};