Skip to main content

LoopProgressMark

Struct LoopProgressMark 

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

Where one integrator’s loop had got to the last time it asked.

Three numbers and nothing else: the furthest record this binding has been offered something from, how many of its deliveries had been closed, and how many asks it has spent since either of those last moved. A round is one ask, which is the only thing that makes “going round without getting anywhere” measurable — the ledger can say what is outstanding but not how many times a host has come back to look at it, and a lease is about exclusion rather than rounds.

The head is this binding’s own, not the engine’s. A cursor walks the global feed and advances over every ceremony in the deployment, so a busy neighbour would move it every second and hide a stall for ever.

Kept on the binding because it is the binding’s, and durable because a process that restarted mid-loop would otherwise come back with a fresh count and go round for ever.

Implementations§

Source§

impl LoopProgressMark

Source

pub const fn new( head: Option<GlobalPosition>, closed: u32, rounds: u32, stuck: u32, ) -> Self

Source

pub fn observing( self, head: Option<GlobalPosition>, closed: u32, owed: Owed, ) -> Self

The mark after one more ask, given what that ask could see.

A round counts against the loop only when the binding was holding work and neither the news nor the work moved. The two halves matter separately. Without the first, a loop that polls while an agent works a long step is declared stuck on its third second. Without the second, a host that takes something and does nothing with it is never noticed.

Both readings are of durable facts — what this binding has been offered, and what it has closed — so the same ask reaches the same conclusion before and after a restart.

Source

pub fn differs_from(self, previous: Self) -> bool

Whether this mark says anything the last one did not.

The ask count always moves, and on its own it changes no decision unless the policy set a ceiling. Everything else is what the stall is read from.

Source

pub const fn head(self) -> Option<GlobalPosition>

How far the feed had been projected when this binding last asked.

Source

pub const fn closed(self) -> u32

Deliveries of this binding’s that had been closed by then.

Source

pub const fn rounds(self) -> u32

Asks this binding has made, over its life.

Source

pub const fn stuck(self) -> u32

Consecutive asks that found the same head and the same closed count as the one before.

Trait Implementations§

Source§

impl Clone for LoopProgressMark

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 Copy for LoopProgressMark

Source§

impl Debug for LoopProgressMark

Source§

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

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

impl Default for LoopProgressMark

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for LoopProgressMark

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for LoopProgressMark

Source§

impl PartialEq for LoopProgressMark

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 Serialize for LoopProgressMark

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LoopProgressMark

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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.