moqtap_proxy/parser/data.rs
1//! Data stream classification shared by the forwarding paths.
2//!
3//! Object-level parsing lives in [`crate::framer`], which frames a whole
4//! stream — header and objects — on every draft 07-19 while preserving the
5//! exact wire bytes. This module keeps only what classifying a stream
6//! needs before the framer is built.
7
8pub use crate::types::DataStreamType;
9
10/// Check if a codec error indicates incomplete data (need more bytes).
11///
12/// The list of spellings this admits lives on the error rather than here. It
13/// was written out twice — once here and once in `moqtap-client`'s framed
14/// readers — and the two copies disagreed: this one admitted a truncated
15/// varint and that one did not, so an object still arriving read as a
16/// malformed stream on every draft. One answer, in the crate that defines the
17/// error.
18pub(crate) fn is_incomplete_error(e: &moqtap_codec::error::CodecError) -> bool {
19 e.is_incomplete()
20}