Trait rtp_types::prelude::RtpPacketWriter
source · pub trait RtpPacketWriter {
type Output;
type Payload: PayloadLength;
type Extension: PayloadLength;
// Required methods
fn push(&mut self, data: &[u8]);
fn push_extension(&mut self, extension_data: &Self::Extension);
fn push_payload(&mut self, payload: &Self::Payload);
fn padding(&mut self, size: u8);
fn finish(&mut self) -> Self::Output;
// Provided methods
fn reserve(&mut self, _size: usize) { ... }
fn max_size(&self) -> Option<usize> { ... }
}Expand description
Trait to write an RTP packet into and/or from custom data types
Required Associated Types§
Required Methods§
sourcefn push(&mut self, data: &[u8])
fn push(&mut self, data: &[u8])
Provides data to append to the output. May be called multiple times per packet.
sourcefn push_extension(&mut self, extension_data: &Self::Extension)
fn push_extension(&mut self, extension_data: &Self::Extension)
Provides the extension data to add to the output. The extension should be written as-is without any transformations.
sourcefn push_payload(&mut self, payload: &Self::Payload)
fn push_payload(&mut self, payload: &Self::Payload)
Provides the payload data to add to the output. The payload should be written as-is without any transformations