Trait RtcpPacketParser

Source
pub trait RtcpPacketParser<'a>: RtcpPacket + Sized {
    // Required methods
    fn parse(data: &'a [u8]) -> Result<Self, RtcpParseError>;
    fn header_data(&self) -> [u8; 4];
}
Expand description

A Trait to ease the implementation of RTCP Packet parsers.

Implementers only need to return the 4 byte RTCP header from RtcpPacketParser::header_data to be able to use the getters for the common RTCP packet fields.

Required Methods§

Source

fn parse(data: &'a [u8]) -> Result<Self, RtcpParseError>

Parses the provided data.

Returns an instance of Self if parsing succeeds, an RtcpParseError otherwise.

Source

fn header_data(&self) -> [u8; 4]

Returns the common header for this RTCP packet.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> RtcpPacketParser<'a> for Packet<'a>

Source§

impl<'a> RtcpPacketParser<'a> for App<'a>

Source§

impl<'a> RtcpPacketParser<'a> for Bye<'a>

Source§

impl<'a> RtcpPacketParser<'a> for PayloadFeedback<'a>

Source§

impl<'a> RtcpPacketParser<'a> for ReceiverReport<'a>

Source§

impl<'a> RtcpPacketParser<'a> for Sdes<'a>

Source§

impl<'a> RtcpPacketParser<'a> for SenderReport<'a>

Source§

impl<'a> RtcpPacketParser<'a> for TransportFeedback<'a>

Source§

impl<'a> RtcpPacketParser<'a> for Unknown<'a>

Source§

impl<'a> RtcpPacketParser<'a> for Xr<'a>