Skip to main content

Packet

Trait Packet 

Source
pub trait Packet:
    Send
    + Sync
    + Marshal
    + Unmarshal
    + Display
    + Debug {
    // Required methods
    fn header(&self) -> Header;
    fn destination_ssrc(&self) -> Vec<u32>;
    fn raw_size(&self) -> usize;
    fn as_any(&self) -> &dyn Any;
    fn equal(&self, other: &dyn Packet) -> bool;
    fn cloned(&self) -> Box<dyn Packet>;
}
Expand description

Packet represents an RTCP packet, a protocol used for out-of-band statistics and control information for an RTP session

Required Methods§

Source

fn header(&self) -> Header

This packet’s RTCP header.

Source

fn destination_ssrc(&self) -> Vec<u32>

The SSRCs this packet is about.

Used to route feedback: a report’s destination SSRCs identify the streams it concerns, which is how an SFU decides where to forward it.

Source

fn raw_size(&self) -> usize

The encoded size in bytes, header and padding included.

Source

fn as_any(&self) -> &dyn Any

Downcasting hook, so a caller holding Box<dyn Packet> can recover the concrete type.

Source

fn equal(&self, other: &dyn Packet) -> bool

Compares against another packet, since PartialEq is not object safe.

Source

fn cloned(&self) -> Box<dyn Packet>

Clones this packet behind a trait object, since Clone is not object safe.

Trait Implementations§

Source§

impl Clone for Box<dyn Packet>

Source§

fn clone(&self) -> Box<dyn Packet>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for dyn Packet

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§