#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
InvalidSync {
word: &'static str,
expected: u16,
found: u16,
},
InvalidValue {
field: &'static str,
value: u64,
reason: &'static str,
},
UnsupportedDataMode(DataMode),
ExtendedPreambleMismatch {
data_type: u8,
expected_extended: bool,
found_extended: bool,
},
PayloadTooLarge {
payload_bits: u32,
extended_offset_bits: u32,
},
}Expand description
An ST 337 burst parse / serialize error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort
Input (on parse) or output buffer (on serialize) shorter than required.
Fields
InvalidSync
Pa or Pb did not equal the fixed 16-bit-mode sync-word constant
(SMPTE ST 337 Table 6, §7.2.1).
Fields
InvalidValue
A field value did not fit its wire bit-width, or a derived count
(length_code vs. actual payload length) was inconsistent.
Fields
UnsupportedDataMode(DataMode)
data_mode (§7.2.4.3 Table 8) was not Mode16. This crate’s
byte-stream abstraction only supports the 16-bit data mode — see
docs/st337.md’s “Scope decisions” §2 for why 20-/24-bit-wide
preamble words are out of scope.
ExtendedPreambleMismatch
data_type == 31 requires the six-word preamble (Pe/Pf present);
any other data_type requires the four-word preamble (Pe/Pf
absent) — SMPTE ST 337 §7.2.1 Table 6 / §7.2.4.2.
Fields
PayloadTooLarge
A payload (plus, for the six-word preamble, Pe+Pf’s 32 bits) would
not fit in the 16-bit-mode length_code’s 0..=65535-bit range
(§7.2.5).
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()