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.
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.