Skip to main content

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).
11pub(crate) fn is_incomplete_error(e: &moqtap_codec::error::CodecError) -> bool {
12    matches!(e, moqtap_codec::error::CodecError::UnexpectedEnd)
13        || matches!(
14            e,
15            moqtap_codec::error::CodecError::VarInt(
16                moqtap_codec::varint::VarIntError::UnexpectedEnd
17            )
18        )
19}