pub struct DataField<'a> {
pub data_identifier: u8,
pub data_units: Vec<DataUnit<'a>>,
}Expand description
The PES data field — ETSI EN 301 775 §4.4.1, Table 1.
A data_identifier (Table 2) followed by a sequence of DataUnits that
fill the PES packet payload. parse walks the units until the buffer is
exhausted; serialize_into emits them back-to-back.
Fields§
§data_identifier: u8data_identifier (8 bits, Table 2): 0x10–0x1F or 0x99–0x9B for
VBI; other values are reserved/user-defined (retained verbatim).
data_units: Vec<DataUnit<'a>>The data units carried in this PES data field.
Implementations§
Source§impl<'a> DataField<'a>
impl<'a> DataField<'a>
Sourcepub fn new(data_identifier: u8, data_units: Vec<DataUnit<'a>>) -> Self
pub fn new(data_identifier: u8, data_units: Vec<DataUnit<'a>>) -> Self
Construct a data field from a data_identifier and its data units.
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Total wire size: 1 (data_identifier) + every data unit.
Sourcepub fn parse(data: &'a [u8]) -> Result<Self>
pub fn parse(data: &'a [u8]) -> Result<Self>
Parse a PES data field from data: the data_identifier byte then a
run of data units until the buffer is exhausted.
Sourcepub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>
pub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>
Serialize the data field into out, returning bytes written.
Trait Implementations§
impl<'a> Eq for DataField<'a>
impl<'a> StructuralPartialEq for DataField<'a>
Auto Trait Implementations§
impl<'a> Freeze for DataField<'a>
impl<'a> RefUnwindSafe for DataField<'a>
impl<'a> Send for DataField<'a>
impl<'a> Sync for DataField<'a>
impl<'a> Unpin for DataField<'a>
impl<'a> UnsafeUnpin for DataField<'a>
impl<'a> UnwindSafe for DataField<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more