Trait rtcp_types::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§
sourcefn parse(data: &'a [u8]) -> Result<Self, RtcpParseError>
fn parse(data: &'a [u8]) -> Result<Self, RtcpParseError>
Parses the provided data.
Returns an instance of Self
if parsing succeeds,
an RtcpParseError
otherwise.
sourcefn header_data(&self) -> [u8; 4]
fn header_data(&self) -> [u8; 4]
Returns the common header for this RTCP packet.
Object Safety§
This trait is not object safe.