pub enum PoolBasis {
Reported,
Derived,
Unstated,
}Expand description
How a pool’s remaining was obtained.
Variants§
Reported
The provider states this pool’s remaining balance directly.
Derived
Computed from a total and a consumption figure that covers several pools at once, so the split between them is not known.
The distinction is load-bearing for any “spend only granted credits”
policy: against a Reported pool it is exact, and against a Derived
one it can only be a ceiling.
Unstated
No basis was stated, or one was stated that this consumer does not
recognise. Treat remaining as a ceiling, never as exact.
This is deliberately its own variant rather than folding an unrecognised
value into Self::Derived. Both are read conservatively, so the
spending behaviour is the same either way — but Derived is a statement
about how a number was obtained, and answering “I do not know” with it
would have the producer assert a fact it does not hold. That is the
failure this type exists to prevent, one level up.
Reading it conservatively is safe in the direction that matters: an exact remainder treated as a ceiling under-spends, while a ceiling treated as exact spends money that may not be there.