pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("buffer too short: need {need}, have {have} ({what})")]
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
#[error("invalid packet_start_code_prefix: {0:#08X} (expected 0x000001)")]
BadStartCode(u32),
#[error("bad timestamp marker bit in {0}")]
BadTimestampMarker(&'static str),
#[error("bad timestamp prefix in {0}")]
BadTimestampPrefix(&'static str),
#[error("optional_fields too large to serialize: {0} bytes (max 255)")]
OptionalFieldsTooLarge(usize),
}