pub struct PartialRun(/* private fields */);Expand description
The partials of one session, gathered so they can be assessed together.
Order-independent: partials are sorted by sequence when assessed, so a run delivered out of order is not mistaken for a run with holes.
Implementations§
Source§impl PartialRun
impl PartialRun
Sourcepub const MAX_REPORTED_MISSING: usize = 10_000
pub const MAX_REPORTED_MISSING: usize = 10_000
How many missing sequence numbers assess will list.
The count is always exact; only the identities are capped. A partial’s
sequence number arrives from the wire, so the size of the hole it
implies is attacker-chosen — the same reasoning as
SequenceTracker::observe’s bound.
Sourcepub fn from_parts(parts: Vec<PartialInfo>) -> Self
pub fn from_parts(parts: Vec<PartialInfo>) -> Self
A run from the partials that have arrived, in any order.
Sourcepub fn push(&mut self, part: PartialInfo)
pub fn push(&mut self, part: PartialInfo)
Add a partial to the run.
Sourcepub fn as_slice(&self) -> &[PartialInfo]
pub fn as_slice(&self) -> &[PartialInfo]
The partials, as supplied.
Sourcepub fn last_cause(&self) -> Option<RecordClosureCause>
pub fn last_cause(&self) -> Option<RecordClosureCause>
The closure cause of the highest-numbered partial present.
What PartialRun::is_explained_loss needs in order to decide whether
a run that simply stops is accounted for.
Sourcepub fn is_explained_loss(&self) -> bool
pub fn is_explained_loss(&self) -> bool
true when the run simply stops, and how it closed accounts for that.
A run whose highest partial reports an abnormal release or a management intervention has an explained ending: the node could not be expected to emit a successor. The same shape after a routine trigger — a volume or time limit — is unexplained loss and must be escalated.
A hole is never explained away: an abnormal ending accounts for a missing successor, not for a missing middle.
A method on the run rather than on Reassembly, because the closure
cause lives here and threading it through the assessment made every
caller carry both halves of one question.
Sourcepub fn assess(&self) -> Reassembly
pub fn assess(&self) -> Reassembly
Assess what the run adds up to.
Duplicated sequence numbers are collapsed: two copies of partial 3 are
one partial 3, and recognising the retransmission is
crate::dedup’s job rather than this one’s.