Skip to main content

Receiver

Struct Receiver 

Source
pub struct Receiver { /* private fields */ }
Expand description

ARQ receiver-side state (draft-sharabayko-srt-01 §4.8.1/§4.8.2/§4.10).

Implementations§

Source§

impl Receiver

Source

pub fn new(dest_socket_id: u32, initial_seq: u32) -> Self

A fresh receiver expecting initial_seq first (the peer’s ISN), addressing dest_socket_id (the peer’s SRT Socket ID, §3).

Source

pub fn ack_point(&self) -> u32

The cumulative ack point — every seq strictly before this has been delivered in order (rule 8’s ACK n + 1 semantics).

Source

pub fn rtt(&self) -> Duration

The current RTT estimate (rules 26-31).

Source

pub fn rtt_var(&self) -> Duration

The current RTTVar estimate.

Source

pub fn loss_list_len(&self) -> usize

Number of sequence numbers currently believed lost.

Source

pub fn feed_data(&mut self, seq_number: u32, now: Duration) -> FeedOutcome

Process one arriving data packet’s sequence number.

Source

pub fn tick(&mut self, now: Duration) -> Vec<Vec<u8>>

Advance to absolute time now and emit any periodic control packets now due: a Full ACK every super::FULL_ACK_PERIOD (rule 11), a Light ACK once super::LIGHT_ACK_THRESHOLD packets have arrived since the last ACK (rule 12), and a periodic NAK once NAKInterval has elapsed and the loss list is non-empty (rules 21, 22) — never a NAK when nothing is believed lost.

Source

pub fn on_ackack(&mut self, ackack: &AckAckPacket, now: Duration)

Process an incoming ACKACK: match it against the outstanding Full ACK it acknowledges and update RTT/RTTVar from the round-trip sample (rules 26-30). An ACKACK for an unknown/already-matched Acknowledgement Number is ignored.

Trait Implementations§

Source§

impl Debug for Receiver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.