Skip to main content

ClaimLoopState

Enum ClaimLoopState 

Source
pub enum ClaimLoopState {
    Idle,
    ChainSourceUnavailable,
    PersistedStateCorrupt,
    CadenceNotElapsed,
    Faulted {
        cycles: u64,
    },
    ClaimableButNotClaiming {
        claimable: u64,
        submitted: u64,
    },
    Nominal,
}
Expand description

The claim loop’s own condition, as the loop last reported it — a closed set of seven members (SPEC §4.4.3). ClaimLoopState mirrors the producer’s enumeration one-to-one, payloads included: a wire type with fewer states than the loop can be in is a new instance of the defect this method exists to remove, a type that cannot say something went wrong.

The tag key is kind, not state — the field holding this type is already named state, and "state": { "state": … } would put two meanings under one key in adjacent positions.

ClaimableButNotClaiming is the state a conforming producer reports whenever claims exist that the loop did not make and no cycle-wide fault is live — the anti-silence signal this method exists to carry. It is never folded into Nominal for lack of anywhere else to go, and a cycle-wide fault is never folded into it either.

The five payload-less members (Idle, ChainSourceUnavailable, PersistedStateCorrupt, CadenceNotElapsed, Nominal) serialise as exactly { "kind": … }. serde does not apply deny_unknown_fields to the payload-less members of an internally tagged enum, so { "kind": "idle", "claimable": 5 } parses as Idle with the stray key silently dropped (SPEC §4.4.1’s one stated vacuity) — a conforming producer never emits the stray key, and a consumer MUST NOT read any key but kind from a payload-less state. The property this type does enforce is the one that carries weight: the counts a reader acts on live on ClaimLoopObservation::Consulted, where unknown and missing keys ARE rejected.

Not #[non_exhaustive], on purpose: a wildcard arm in a consumer is #[serde(other)] relocated to the render path, deciding at compile time that a state nobody has heard of renders as something bland. A new member is a SPEC amendment and a breaking release for every consumer.

Variants§

§

Idle

No cycle has been attempted yet.

§

ChainSourceUnavailable

The chain seam reported itself unavailable; no cycle ran. The true state, not a silent no-op.

§

PersistedStateCorrupt

The loop’s persisted claim state was unreadable, unparsable, over its own budget or future-dated; the loop treats its spend window as exhausted and submits nothing this cycle. A refusal made visible, not a freeze that reads as Nominal.

§

CadenceNotElapsed

The claim cadence has not elapsed since the last completed cycle: a deliberate skip, named as its own condition rather than left as the absence of one.

§

Faulted

A chain call this cycle failed with a real error, distinct from “no chain at all”.

Fields

§cycles: u64

Consecutive cycles, including the current one, on which the loop has observed a cycle-wide fault. From a conforming producer this is at least 1; the type does not reject 0.

§

ClaimableButNotClaiming

Fewer distributors were claimed against this cycle than should have been, and no fault is live. The anti-silence signal: the loop is running and paying nobody, or not everybody. This is the state reported whenever claims exist and none are being made.

Fields

§claimable: u64

This cycle’s distributors that should have been claimed against. A count of distributors, never an amount, and at least ClaimLoopObservation::Consulted’s own distributors_claimable — the producer folds in refusals it never counted as claimable.

§submitted: u64

This cycle’s distributors actually claimed against. From a conforming producer, strictly less than claimable; the type does not reject the contrary.

§

Nominal

A cycle completed and none of the above is true.

Trait Implementations§

Source§

impl Clone for ClaimLoopState

Source§

fn clone(&self) -> ClaimLoopState

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 ClaimLoopState

Source§

impl Debug for ClaimLoopState

Source§

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

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

impl<'de> Deserialize<'de> for ClaimLoopState

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 ClaimLoopState

Source§

impl PartialEq for ClaimLoopState

Source§

fn eq(&self, other: &ClaimLoopState) -> 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 ClaimLoopState

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 ClaimLoopState

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