1pub type Result<T> = core::result::Result<T, Error>;
5
6#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
8#[non_exhaustive]
9pub enum Error {
10 #[error("buffer too short: need {need}, have {have} ({what})")]
12 BufferTooShort {
13 need: usize,
15 have: usize,
17 what: &'static str,
19 },
20 #[error("invalid packet_start_code_prefix: {0:#08X} (expected 0x000001)")]
22 BadStartCode(u32),
23 #[error("bad timestamp marker bit in {0}")]
25 BadTimestampMarker(&'static str),
26 #[error("bad timestamp prefix in {0}")]
28 BadTimestampPrefix(&'static str),
29 #[error("optional_fields too large to serialize: {0} bytes (max 255)")]
32 OptionalFieldsTooLarge(usize),
33}