pub struct MutableReportBlockPacket<'p> { /* private fields */ }Expand description
A structure enabling manipulation of on the wire packets
Implementations§
Source§impl<'a> MutableReportBlockPacket<'a>
impl<'a> MutableReportBlockPacket<'a>
Sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableReportBlockPacket<'p>>
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableReportBlockPacket<'p>>
Constructs a new MutableReportBlockPacket. If the provided buffer is less than the minimum required packet size, this will return None.
Sourcepub fn owned(packet: Vec<u8>) -> Option<MutableReportBlockPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<MutableReportBlockPacket<'static>>
Constructs a new MutableReportBlockPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the MutableReportBlockPacket will own its own data and the underlying buffer will be dropped when the MutableReportBlockPacket is.
Sourcepub fn to_immutable<'p>(&'p self) -> ReportBlockPacket<'p>
pub fn to_immutable<'p>(&'p self) -> ReportBlockPacket<'p>
Maps from a MutableReportBlockPacket to a ReportBlockPacket
Sourcepub fn consume_to_immutable(self) -> ReportBlockPacket<'a>
pub fn consume_to_immutable(self) -> ReportBlockPacket<'a>
Maps from a MutableReportBlockPacket to a ReportBlockPacket 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: &ReportBlock) -> usize
pub fn packet_size(_packet: &ReportBlock) -> usize
The size (in bytes) of a ReportBlock instance when converted into a byte-array
Sourcepub fn populate(&mut self, packet: &ReportBlock)
pub fn populate(&mut self, packet: &ReportBlock)
Populates a ReportBlockPacket using a ReportBlock structure
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 get_fraction_lost(&self) -> u8
pub fn get_fraction_lost(&self) -> u8
Get the fraction_lost field.
Sourcepub fn get_cumulative_pkts_lost(&self) -> u24be
pub fn get_cumulative_pkts_lost(&self) -> u24be
Get the cumulative_pkts_lost field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_cycles(&self) -> u16be
pub fn get_cycles(&self) -> u16be
Get the cycles field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_sequence(&self) -> u16be
pub fn get_sequence(&self) -> u16be
Get the sequence field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_interarrival_jitter(&self) -> u32be
pub fn get_interarrival_jitter(&self) -> u32be
Get the interarrival_jitter field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_last_sr_timestamp(&self) -> u32be
pub fn get_last_sr_timestamp(&self) -> u32be
Get the last_sr_timestamp field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_last_sr_delay(&self) -> u32be
pub fn get_last_sr_delay(&self) -> u32be
Get the last_sr_delay field. This field is always stored big-endian within the struct, but this accessor returns 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_fraction_lost(&mut self, val: u8)
pub fn set_fraction_lost(&mut self, val: u8)
Set the fraction_lost field.
Sourcepub fn set_cumulative_pkts_lost(&mut self, val: u24be)
pub fn set_cumulative_pkts_lost(&mut self, val: u24be)
Set the cumulative_pkts_lost field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_cycles(&mut self, val: u16be)
pub fn set_cycles(&mut self, val: u16be)
Set the cycles field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_sequence(&mut self, val: u16be)
pub fn set_sequence(&mut self, val: u16be)
Set the sequence field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_interarrival_jitter(&mut self, val: u32be)
pub fn set_interarrival_jitter(&mut self, val: u32be)
Set the interarrival_jitter field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_last_sr_timestamp(&mut self, val: u32be)
pub fn set_last_sr_timestamp(&mut self, val: u32be)
Set the last_sr_timestamp field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_last_sr_delay(&mut self, val: u32be)
pub fn set_last_sr_delay(&mut self, val: u32be)
Set the last_sr_delay 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 MutableReportBlockPacket<'p>
impl<'p> Debug for MutableReportBlockPacket<'p>
Source§impl<'p> FromPacket for MutableReportBlockPacket<'p>
impl<'p> FromPacket for MutableReportBlockPacket<'p>
Source§type T = ReportBlock
type T = ReportBlock
Source§fn from_packet(&self) -> ReportBlock
fn from_packet(&self) -> ReportBlock
Source§impl<'a> MutablePacket for MutableReportBlockPacket<'a>
impl<'a> MutablePacket for MutableReportBlockPacket<'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 MutableReportBlockPacket<'a>
impl<'a> Packet for MutableReportBlockPacket<'a>
Source§impl<'a> PacketSize for MutableReportBlockPacket<'a>
impl<'a> PacketSize for MutableReportBlockPacket<'a>
Source§fn packet_size(&self) -> usize
fn packet_size(&self) -> usize
Source§impl<'p> PartialEq for MutableReportBlockPacket<'p>
impl<'p> PartialEq for MutableReportBlockPacket<'p>
Source§fn eq(&self, other: &MutableReportBlockPacket<'p>) -> bool
fn eq(&self, other: &MutableReportBlockPacket<'p>) -> bool
self and other values to be equal, and is used by ==.