Skip to main content

ClaimLogObservation

Enum ClaimLogObservation 

Source
pub enum ClaimLogObservation {
    Consulted {
        observed_at: u64,
        claims_submitted_count: u64,
    },
    NotConsulted {
        observed_at: u64,
    },
}
Expand description

What a node can say about its own claim log: it read the log and has a count, or it did not read the log and has no count to give.

§Why the count is inside the variant

The count and the fact that anything was counted cannot be separated, for the same reason Half’s items live inside Consulted. A node whose claim log is missing, unreadable, or failed to read has nothing to report, and a claims_submitted_count: 0 beside a freshly stamped observed_at is worse than an undated zero: the date actively reassures the reader that something looked at the log just now and found nothing, which is dig-rewards-coin SPEC §12.5 clause 6’s “reassuring zero” reproduced inside the type added to remove it. There is no arm here that can carry a count without having read the log.

This is a sibling of Half rather than an instance of it: Half answers for a collection and carries items, and forcing a scalar tally through it would mean either a vacuous Vec or a wire key that names the wrong thing. The vocabulary — outcome, two arms, observed_at in both — is deliberately identical, so a reader who has learned one has learned the other.

observed_at dates the consultation, not the assembly of the answer: in Consulted it is when the log was read, and in NotConsulted it is when the responder established that it could not read it. Fail-closed like Half: internally tagged, no #[serde(other)], no Default, no skip_serializing_if.

Variants§

§

Consulted

The claim log WAS read as of observed_at (Unix seconds), and claims_submitted_count is what it held.

Fields

§observed_at: u64

Unix seconds the claim log was read.

§claims_submitted_count: u64

How many claim submissions this node has made as a payee. A count of attempts, not of money: it says nothing about how much was settled, and a reader MUST NOT treat it as an amount or as a success count.

§

NotConsulted

The claim log was NOT read as of observed_at (Unix seconds) — missing, unreadable, or the read failed. There is deliberately no count here.

Fields

§observed_at: u64

Unix seconds the responder established it could not read the log.

Trait Implementations§

Source§

impl Clone for ClaimLogObservation

Source§

fn clone(&self) -> ClaimLogObservation

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 ClaimLogObservation

Source§

impl Debug for ClaimLogObservation

Source§

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

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

impl<'de> Deserialize<'de> for ClaimLogObservation

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 ClaimLogObservation

Source§

impl PartialEq for ClaimLogObservation

Source§

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

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 ClaimLogObservation

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.