pub struct ReportBlock { /* private fields */ }Expand description
Sender/receiver report block.
Implementations§
Source§impl ReportBlock
impl ReportBlock
Sourcepub fn decode(data: &mut Bytes) -> Result<Self, InvalidInput>
pub fn decode(data: &mut Bytes) -> Result<Self, InvalidInput>
Decode a report block from given data.
Sourcepub fn fractional_loss(&self) -> u8
pub fn fractional_loss(&self) -> u8
Get fractional loss as 0.8 fixed point number.
Sourcepub fn with_fractional_loss(self, loss: u8) -> Self
pub fn with_fractional_loss(self, loss: u8) -> Self
Set fractional loss as 0.8 fixed point number.
Sourcepub fn cumulative_loss(&self) -> i32
pub fn cumulative_loss(&self) -> i32
Get cumulative packet loss (the precision is only up to 24 bits).
Sourcepub fn with_cumulative_loss(self, loss: i32) -> Self
pub fn with_cumulative_loss(self, loss: i32) -> Self
Set cumulative packet loss (the precision is only up to 24 bits).
Sourcepub fn with_loss(self, expected: u64, received: u64) -> Self
pub fn with_loss(self, expected: u64, received: u64) -> Self
Set loss calculated from a given number of expected packets vs. a given number of received packets.
Sourcepub fn extended_sequence_number(&self) -> u32
pub fn extended_sequence_number(&self) -> u32
Get extended highest sequence number.
Sourcepub fn with_extended_sequence_number(self, n: u32) -> Self
pub fn with_extended_sequence_number(self, n: u32) -> Self
Set the extended sequence number.
Sourcepub fn with_jitter(self, jitter: u32) -> Self
pub fn with_jitter(self, jitter: u32) -> Self
Set the jitter.
Sourcepub fn last_sr_timestamp(&self) -> u64
pub fn last_sr_timestamp(&self) -> u64
Get NTP timestamp of the last sender report (after truncating to the middle 32 bits).
The returned timestamp is a 32.32 fixed point number.
Sourcepub fn with_last_sr_timestamp(self, ts: u64) -> Self
pub fn with_last_sr_timestamp(self, ts: u64) -> Self
Set NTP timestamp of the last sender report.
The timestamp is expected to be a 32.32 fixed point number and it will be truncated to the middle 32 bits.
Sourcepub fn delay_since_last_sr(&self) -> Duration
pub fn delay_since_last_sr(&self) -> Duration
Get delay since the last sender report.
Sourcepub fn with_delay_since_last_sr(self, delay: Duration) -> Self
pub fn with_delay_since_last_sr(self, delay: Duration) -> Self
Set delay since the last sender report.
Trait Implementations§
Source§impl Clone for ReportBlock
impl Clone for ReportBlock
Source§fn clone(&self) -> ReportBlock
fn clone(&self) -> ReportBlock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more