pub trait Packetizer:
Send
+ Sync
+ Debug {
// Required methods
fn enable_abs_send_time(&mut self, value: u8);
fn packetize(
&mut self,
now: Instant,
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,
now: Instant,
payload: &Bytes,
samples: u32,
) -> Result<Vec<Packet>>
fn packetize( &mut self, now: Instant, 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. now is the instant the frame is being sent at; it is what
the absolute-send-time extension is derived from, so the caller supplies it rather than
the packetizer sampling a clock of its own.
§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".