pub struct HeaderExtension<'a> {
pub profile_id: u16,
pub data: &'a [u8],
}Expand description
The RTP generic header extension (§5.3.1): a 16-bit profile-specific identifier + opaque profile-specific data.
The data bytes are genuinely opaque at this layer — RFC 3550 itself
defines no further structure (“the actual format of the extension is
specified by the profile”). This mirrors the project’s precedent for
spec-opaque payloads (e.g. smpte2038’s undecoded ST 291-1
checksum/parity): a raw &[u8] here is not a “raw-byte API” violation
because there is no further spec structure to type.
Fields§
§profile_id: u16defined by profile — a 16-bit identifier whose meaning is entirely
profile-specific (§5.3.1).
data: &'a [u8]The extension data. Its on-the-wire length (in 32-bit words) is
always derived from data.len() / 4 on serialize — never stored as an
independent field that could disagree with the slice. data.len()
MUST be a multiple of 4 (§5.3.1: length counts whole 32-bit words).
Implementations§
Source§impl HeaderExtension<'_>
impl HeaderExtension<'_>
Sourcepub fn length_words(&self) -> usize
pub fn length_words(&self) -> usize
The length field value that will be written on serialize: the number
of 32-bit words in data (§5.3.1, “excluding the four-octet extension
header”).
Trait Implementations§
Source§impl<'a> Clone for HeaderExtension<'a>
impl<'a> Clone for HeaderExtension<'a>
Source§fn clone(&self) -> HeaderExtension<'a>
fn clone(&self) -> HeaderExtension<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for HeaderExtension<'a>
Source§impl<'a> Debug for HeaderExtension<'a>
impl<'a> Debug for HeaderExtension<'a>
impl<'a> Eq for HeaderExtension<'a>
Source§impl<'a> PartialEq for HeaderExtension<'a>
impl<'a> PartialEq for HeaderExtension<'a>
Source§impl<'a> Serialize for HeaderExtension<'a>
Available on crate feature serde only.
impl<'a> Serialize for HeaderExtension<'a>
serde only.