Trait RtcpPacketWriter

Source
pub trait RtcpPacketWriter: Debug {
    // Required methods
    fn calculate_size(&self) -> Result<usize, RtcpWriteError>;
    fn write_into_unchecked(&self, buf: &mut [u8]) -> usize;
    fn get_padding(&self) -> Option<u8>;
}
Expand description

A Trait with base functions needed for RTCP Packet writers.

Note: this trait must remain object-safe.

Required Methods§

Source

fn calculate_size(&self) -> Result<usize, RtcpWriteError>

Calculates the size required to write this RTCP packet.

Also performs validity checks.

Source

fn write_into_unchecked(&self, buf: &mut [u8]) -> usize

Writes this RTCP packet into buf without any validity checks.

Uses the length of the buffer for the length field.

Returns the number of bytes written.

§Panic

Panics if the buf is not large enough.

Source

fn get_padding(&self) -> Option<u8>

Gets the padding that was configured for this RTCP packet.

Implementors§