pub struct LocalSet<'a> {
pub key: UlBytes,
pub items: Vec<LocalSetItem<'a>>,
}Expand description
A Header Metadata Set encoded with MXF’s “local set” framing (§9.3): a
16-byte Set Key identifying which Set this is (see
StructuralSetKind), a BER Length, and a sequence of
LocalSetItems.
Fields§
§key: UlBytesThe Set Key (all 16 bytes, as found on the wire).
items: Vec<LocalSetItem<'a>>The Set’s items, in on-wire order.
Implementations§
Source§impl<'a> LocalSet<'a>
impl<'a> LocalSet<'a>
Sourcepub fn kind(&self) -> StructuralSetKind
pub fn kind(&self) -> StructuralSetKind
This Set’s Kind (Table 17), from its Key’s bytes 14/15.
Sourcepub fn item_length_mode(&self) -> ItemLengthMode
pub fn item_length_mode(&self) -> ItemLengthMode
This Set’s item length mode (Table 16 byte 6).
key is a public field (callers can build a LocalSet directly, not
only via LocalSet::parse_prefix), so this cannot assume byte 6 is
one of the two valid values — falls back to ItemLengthMode::TwoByte
(the spec’s own documented default) rather than panicking on a
self-constructed LocalSet with an invalid key.
Sourcepub fn build_key(kind: StructuralSetKind, mode: ItemLengthMode) -> UlBytes
pub fn build_key(kind: StructuralSetKind, mode: ItemLengthMode) -> UlBytes
Build a fresh Local Set Key for kind, using mode for the item
length encoding and registry version 0x01.
Sourcepub fn parse_prefix(bytes: &'a [u8]) -> Result<(Self, usize)>
pub fn parse_prefix(bytes: &'a [u8]) -> Result<(Self, usize)>
Parse one Local Set (Key + BER Length + items) from the start of
bytes, returning it with the total bytes consumed — use this to
walk a sequence of Header Metadata Sets in a stream.
Trait Implementations§
impl<'a> Eq for LocalSet<'a>
Source§impl Serialize for LocalSet<'_>
impl Serialize for LocalSet<'_>
Source§type Error = Error
type Error = Error
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
serialize_into will write.