pub trait Packetizer:
Send
+ Sync
+ Debug {
// Required methods
fn enable_abs_send_time(&mut self, value: u8);
fn packetize(
&mut self,
payload: &Bytes,
samples: u32,
) -> Result<Vec<Packet>>;
fn skip_samples(&mut self, skipped_samples: u32);
fn clone_to(&self) -> Box<dyn Packetizer>;
}Expand description
Packetizer packetizes a payload
Required Methods§
Sourcefn enable_abs_send_time(&mut self, value: u8)
fn enable_abs_send_time(&mut self, value: u8)
Attaches the absolute-send-time header extension under id value.
Sourcefn packetize(&mut self, payload: &Bytes, samples: u32) -> Result<Vec<Packet>>
fn packetize(&mut self, payload: &Bytes, samples: u32) -> Result<Vec<Packet>>
Packetizes one frame, advancing the timestamp by samples.
Assigns sequence numbers, sets the marker bit on the final packet, and applies any enabled header extensions.
§Errors
Propagates payloader failures.
Sourcefn skip_samples(&mut self, skipped_samples: u32)
fn skip_samples(&mut self, skipped_samples: u32)
Advances the timestamp without sending anything, for dropped or silent frames.
Sourcefn clone_to(&self) -> Box<dyn Packetizer>
fn clone_to(&self) -> Box<dyn Packetizer>
Clones this packetizer behind a trait object.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".