#[non_exhaustive]pub enum SrtPacket<'a> {
Data(DataPacket<'a>),
Control(ControlPacket<'a>),
}Expand description
A parsed SRT packet — the payload of one UDP datagram carrying SRT traffic
(draft-sharabayko-srt-01 §3, Figure 1 / Figure 2).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Data(DataPacket<'a>)
F=0: a data packet (§3.1).
Control(ControlPacket<'a>)
F=1: a control packet (§3.2).
Implementations§
Source§impl<'a> SrtPacket<'a>
impl<'a> SrtPacket<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self>
pub fn parse(bytes: &'a [u8]) -> Result<Self>
Parse one SRT packet from bytes — the full payload of one UDP
datagram carrying SRT traffic. Dispatches on the F bit of the first
header word (§3, Figure 2).
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Number of bytes Self::serialize_into will write.
Sourcepub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serialize this packet into buf. Returns the number of bytes written.
Trait Implementations§
impl<'a> StructuralPartialEq for SrtPacket<'a>
Auto Trait Implementations§
impl<'a> Freeze for SrtPacket<'a>
impl<'a> RefUnwindSafe for SrtPacket<'a>
impl<'a> Send for SrtPacket<'a>
impl<'a> Sync for SrtPacket<'a>
impl<'a> Unpin for SrtPacket<'a>
impl<'a> UnsafeUnpin for SrtPacket<'a>
impl<'a> UnwindSafe for SrtPacket<'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