Skip to main content

PartialRun

Struct PartialRun 

Source
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

Source

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.

Source

pub const fn new() -> Self

An empty run.

Source

pub fn from_parts(parts: Vec<PartialInfo>) -> Self

A run from the partials that have arrived, in any order.

Source

pub fn push(&mut self, part: PartialInfo)

Add a partial to the run.

Source

pub fn len(&self) -> usize

How many partials have arrived.

Source

pub fn is_empty(&self) -> bool

true when nothing has arrived.

Source

pub fn as_slice(&self) -> &[PartialInfo]

The partials, as supplied.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for PartialRun

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PartialRun

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for PartialRun

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for PartialRun

Source§

impl FromIterator<PartialInfo> for PartialRun

Source§

fn from_iter<I: IntoIterator<Item = PartialInfo>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl PartialEq for PartialRun

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PartialRun

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.