pub struct Numbering { /* private fields */ }Expand description
The UAS’s numbering of reliable provisionals within one transaction (RFC 3262 §3).
Implementations§
Source§impl Numbering
impl Numbering
Sourcepub fn starting_at(first: u32) -> Self
pub fn starting_at(first: u32) -> Self
Start numbering at first, which must be in 1..=MAX_FIRST_RSEQ.
The value is supplied rather than generated here because this crate has no randomness and wants none — a sans-IO core that reaches for an entropy source has stopped being one. Out-of-range values are clamped into the legal window rather than rejected: the caller cannot usefully handle a failure to pick a number, and a number outside the window is a protocol violation this side would be committing.
Sourcepub fn allocate(&mut self) -> Option<u32>
pub fn allocate(&mut self) -> Option<u32>
The number for the next reliable provisional, or None if one is still unacknowledged.
§3: “The UAS MUST NOT send a second reliable provisional response until the first is acknowledged.” Enforced by returning nothing rather than by trusting the caller, because the guarantee the mechanism sells — that the peer received these in order — is exactly what a second unacknowledged response destroys.
Sourcepub fn outstanding(&self) -> Option<u32>
pub fn outstanding(&self) -> Option<u32>
The response still waiting for a PRACK.
Sourcepub fn acknowledge(&mut self, ack: &RAck, cseq: u32, method: &[u8]) -> bool
pub fn acknowledge(&mut self, ack: &RAck, cseq: u32, method: &[u8]) -> bool
Whether this RAck acknowledges the outstanding response, and clear it if so.
§3 defines a match as same dialog, and RAck’s three fields equal to the response’s
RSeq and the request’s CSeq number and method. The dialog is the caller’s to check;
everything else is here.