#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
BerIndefiniteLength,
BerLengthTooLong {
bytes: usize,
},
InvalidKeyLength {
found: usize,
},
UnknownPartitionKind {
byte: u8,
},
UnknownPartitionStatus {
byte: u8,
},
OpenFooterPartition {
byte: u8,
},
KeyPrefixMismatch {
what: &'static str,
},
MissingRequiredProperty {
tag: u16,
name: &'static str,
set: &'static str,
},
InvalidPropertyLength {
tag: u16,
name: &'static str,
found: usize,
expected: usize,
},
InvalidBatchHeader {
count: u32,
item_len: u32,
buffer_len: usize,
},
InvalidUtf16 {
tag: u16,
name: &'static str,
},
}Expand description
An MXF 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
BerIndefiniteLength
A BER length token used the reserved “unspecified length” value
(0x80 with zero following bytes), forbidden in MXF files
(docs/st377-1.md §6.3.4).
BerLengthTooLong
A BER long-form length used more following bytes than an unsigned 64-bit length could ever need, or than MXF’s own 9-byte cap (1 header + up to 8 length bytes, §6.3.4) allows.
InvalidKeyLength
A KLV Key was not the expected 16 bytes ( §6.3.8 — MXF Keys and
Universal Labels are always exactly 16 bytes; this only fires when
a caller-supplied buffer is short, since crate::klv::KlvItem
itself always reads exactly 16).
UnknownPartitionKind
A Partition Pack’s Key byte 14 (Partition Kind) was not one of the
three defined values (docs/st377-1.md §7.1 Table 4).
UnknownPartitionStatus
A Partition Pack’s Key byte 15 (Partition Status) was not one of
the four defined values (docs/st377-1.md §7.1 Table 4 / §6.2.3).
A Footer Partition Pack (Table 8) used an Open status byte, which §7.4.1’s note forbids (“Open Footer Partitions are not permitted”).
KeyPrefixMismatch
A KLV Key did not match the expected fixed 13-byte Partition Pack /
Primer Pack / Random Index Pack prefix (docs/st377-1.md §7.1
Table 4 / §9.2 Table 13 / §12.1 Table 29).
MissingRequiredProperty
A required Header Metadata property (Annex A) was absent from a
typed Set’s underlying crate::LocalSet.
Fields
InvalidPropertyLength
A property’s value had a length that does not match its fixed-size wire type (e.g. a 16-byte UUID field encoded with fewer/more bytes).
Fields
InvalidBatchHeader
A Batch/Array’s 8-byte header (count: u32, item_len: u32) did
not agree with the actual buffer length, or item_len did not
match the expected fixed element size (docs/st377-1.md §4.3).
Fields
InvalidUtf16
A UTF-16 string property contained an invalid UTF-16 code unit sequence (unpaired surrogate).
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()