Struct msf_rtp::rtcp::RtcpHeader
source · [−]pub struct RtcpHeader { /* private fields */ }
Expand description
RTCP header.
Implementations
sourceimpl 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
sourceimpl Clone for RtcpHeader
impl Clone for RtcpHeader
sourcefn clone(&self) -> RtcpHeader
fn clone(&self) -> RtcpHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for RtcpHeader
Auto Trait Implementations
impl RefUnwindSafe for RtcpHeader
impl Send for RtcpHeader
impl Sync for RtcpHeader
impl Unpin for RtcpHeader
impl UnwindSafe for RtcpHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more