pub struct RtcpHeader { /* private fields */ }Expand description
RTCP header.
Implementations§
Source§impl RtcpHeader
impl RtcpHeader
Sourcepub const fn new(packet_type: RtcpPacketType) -> Self
pub const fn new(packet_type: RtcpPacketType) -> Self
Create a new packet header.
Sourcepub fn decode(data: &mut Bytes) -> Result<Self, InvalidInput>
pub fn decode(data: &mut Bytes) -> Result<Self, InvalidInput>
Decode an RTCP header.
Sourcepub fn with_padding(self, padding: bool) -> Self
pub fn with_padding(self, padding: bool) -> Self
Set the padding bit.
Sourcepub fn packet_length(&self) -> usize
pub fn packet_length(&self) -> usize
Get packet length in bytes.
Sourcepub fn with_packet_length(self, length: usize) -> Self
pub fn with_packet_length(self, length: usize) -> Self
Set the packet length in bytes.
Please note that the packet length must be a multiple of four and it
must be from the range 4..=262_144.
§Panics
The method panics if the constraints on the packet length mentioned above are not met.
Sourcepub fn packet_type(&self) -> RtcpPacketType
pub fn packet_type(&self) -> RtcpPacketType
Get RTCP packet type.
Sourcepub fn with_packet_type(self, packet_type: RtcpPacketType) -> Self
pub fn with_packet_type(self, packet_type: RtcpPacketType) -> Self
Set RTCP packet type.
Sourcepub fn item_count(&self) -> u8
pub fn item_count(&self) -> u8
Get number of items in the packet body.
Note: Only the lower 5 bits are actually used.
Sourcepub fn with_item_count(self, count: u8) -> Self
pub fn with_item_count(self, count: u8) -> Self
Set the number of items in the packet body.
§Panics
The method panics if the number of items is greater than 31.
Trait Implementations§
Source§impl Clone for RtcpHeader
impl Clone for RtcpHeader
Source§fn clone(&self) -> RtcpHeader
fn clone(&self) -> RtcpHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RtcpHeader
Auto Trait Implementations§
impl Freeze for RtcpHeader
impl RefUnwindSafe for RtcpHeader
impl Send for RtcpHeader
impl Sync for RtcpHeader
impl Unpin for RtcpHeader
impl UnwindSafe for RtcpHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more