Struct discortp::rtcp::report::MutableReceiverReportPacket
source · pub struct MutableReceiverReportPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
source§impl<'a> MutableReceiverReportPacket<'a>
impl<'a> MutableReceiverReportPacket<'a>
sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableReceiverReportPacket<'p>>
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableReceiverReportPacket<'p>>
Constructs a new MutableReceiverReportPacket. If the provided buffer is less than the minimum required packet size, this will return None.
sourcepub fn owned(packet: Vec<u8>) -> Option<MutableReceiverReportPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<MutableReceiverReportPacket<'static>>
Constructs a new MutableReceiverReportPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the MutableReceiverReportPacket will own its own data and the underlying buffer will be dropped when the MutableReceiverReportPacket is.
sourcepub fn to_immutable<'p>(&'p self) -> ReceiverReportPacket<'p>
pub fn to_immutable<'p>(&'p self) -> ReceiverReportPacket<'p>
Maps from a MutableReceiverReportPacket to a ReceiverReportPacket
sourcepub fn consume_to_immutable(self) -> ReceiverReportPacket<'a>
pub fn consume_to_immutable(self) -> ReceiverReportPacket<'a>
Maps from a MutableReceiverReportPacket to a ReceiverReportPacket while consuming the source
sourcepub const fn minimum_packet_size() -> usize
pub const fn minimum_packet_size() -> usize
The minimum size (in bytes) a packet of this type can be. It’s based on the total size of the fixed-size fields.
sourcepub fn packet_size(_packet: &ReceiverReport) -> usize
pub fn packet_size(_packet: &ReceiverReport) -> usize
The size (in bytes) of a ReceiverReport instance when converted into a byte-array
sourcepub fn populate(&mut self, packet: &ReceiverReport)
pub fn populate(&mut self, packet: &ReceiverReport)
Populates a ReceiverReportPacket using a ReceiverReport structure
sourcepub fn get_version(&self) -> u2
pub fn get_version(&self) -> u2
Get the version field.
sourcepub fn get_padding(&self) -> u1
pub fn get_padding(&self) -> u1
Get the padding field.
sourcepub fn get_rx_report_count(&self) -> u5
pub fn get_rx_report_count(&self) -> u5
Get the rx_report_count field.
sourcepub fn get_packet_type(&self) -> RtcpType
pub fn get_packet_type(&self) -> RtcpType
Get the value of the packet_type field
sourcepub fn get_pkt_length(&self) -> u16be
pub fn get_pkt_length(&self) -> u16be
Get the pkt_length field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_ssrc(&self) -> u32be
pub fn get_ssrc(&self) -> u32be
Get the ssrc field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn set_version(&mut self, val: u2)
pub fn set_version(&mut self, val: u2)
Set the version field.
sourcepub fn set_padding(&mut self, val: u1)
pub fn set_padding(&mut self, val: u1)
Set the padding field.
sourcepub fn set_rx_report_count(&mut self, val: u5)
pub fn set_rx_report_count(&mut self, val: u5)
Set the rx_report_count field.
sourcepub fn set_packet_type(&mut self, val: RtcpType)
pub fn set_packet_type(&mut self, val: RtcpType)
Set the value of the packet_type field.
sourcepub fn set_pkt_length(&mut self, val: u16be)
pub fn set_pkt_length(&mut self, val: u16be)
Set the pkt_length field. This field is always stored big-endian within the struct, but this mutator wants host order.
sourcepub fn set_ssrc(&mut self, val: u32be)
pub fn set_ssrc(&mut self, val: u32be)
Set the ssrc field. This field is always stored big-endian within the struct, but this mutator wants host order.
sourcepub fn set_payload(&mut self, vals: &[u8])
pub fn set_payload(&mut self, vals: &[u8])
Set the value of the payload field (copies contents)
Trait Implementations§
source§impl<'p> Debug for MutableReceiverReportPacket<'p>
impl<'p> Debug for MutableReceiverReportPacket<'p>
source§impl<'p> FromPacket for MutableReceiverReportPacket<'p>
impl<'p> FromPacket for MutableReceiverReportPacket<'p>
§type T = ReceiverReport
type T = ReceiverReport
source§fn from_packet(&self) -> ReceiverReport
fn from_packet(&self) -> ReceiverReport
source§impl<'a> MutablePacket for MutableReceiverReportPacket<'a>
impl<'a> MutablePacket for MutableReceiverReportPacket<'a>
source§fn packet_mut<'p>(&'p mut self) -> &'p mut [u8]
fn packet_mut<'p>(&'p mut self) -> &'p mut [u8]
source§fn payload_mut<'p>(&'p mut self) -> &'p mut [u8]
fn payload_mut<'p>(&'p mut self) -> &'p mut [u8]
source§fn clone_from<T>(&mut self, other: &T)where
T: Packet,
fn clone_from<T>(&mut self, other: &T)where T: Packet,
source§impl<'a> Packet for MutableReceiverReportPacket<'a>
impl<'a> Packet for MutableReceiverReportPacket<'a>
source§impl<'a> PacketSize for MutableReceiverReportPacket<'a>
impl<'a> PacketSize for MutableReceiverReportPacket<'a>
source§fn packet_size(&self) -> usize
fn packet_size(&self) -> usize
source§impl<'p> PartialEq for MutableReceiverReportPacket<'p>
impl<'p> PartialEq for MutableReceiverReportPacket<'p>
source§fn eq(&self, other: &MutableReceiverReportPacket<'p>) -> bool
fn eq(&self, other: &MutableReceiverReportPacket<'p>) -> bool
self
and other
values to be equal, and is used
by ==
.