pub struct Pool {
pub id: String,
pub label: String,
pub funding: PoolFunding,
pub remaining: Option<Amount>,
pub total: Option<Amount>,
pub basis: PoolBasis,
pub spendable: Option<bool>,
pub resets_at: Option<String>,
}Expand description
A prepaid balance or credit pool on an account.
Plural by necessity: one figure cannot express “9.50 granted and 40 purchased”, which is exactly the distinction a consumer needs to spend the first without spending the second.
Fields§
§id: StringThe provider’s own name for this pool, never one invented here.
Providers separate pools without always defining them — a wallet may list
voucher, cash and credit balances and document none of them. Passing the
provider’s name through lets a consumer decide; renaming one granted
would be inventing the label a spend policy keys on.
label: StringHuman-readable name for display.
funding: PoolFundingWhat funds this pool.
remaining: Option<Amount>What is left, when it can be established.
total: Option<Amount>The pool’s size, when the provider reports one.
basis: PoolBasisHow remaining was obtained. Read it before acting on remaining.
spendable: Option<bool>Whether the provider says this pool may currently be drawn on.
Read from the provider, never inferred from remaining > 0: a pool can
be non-empty and closed, which several providers publish directly through
their own enable flags. Absent means the provider does not say.
resets_at: Option<String>When the pool’s period renews, as RFC 3339, if the provider states one.
Absent means not stated, never “does not renew”. Some providers state
a period for a money pool (a monthly workspace credit limit with its own
reset time); others state none for a pool that may well be monthly (paid
overage named monthly_limit with no date anywhere in the payload). A
consumer that reads absence as “this balance is all there will ever be”
under-spends at best, and at worst treats a pool that refills on the 1st
as permanently exhausted.
A producer sets it only from a value the provider sent. A period guessed from a field name is the fabricated-precision failure this crate refuses everywhere else.