pub enum CacheWritePolicy {
Rate(f64),
DocumentedAsInputRate(&'static str),
Unpublished,
}Expand description
How a hand-sourced row bills cache-creation (cache-write) tokens.
The distinction matters because “no separate write rate published” and
“documented to cost the same as ordinary input” are different facts that used
to collapse onto the same None. Folding the unknown case into the input
rate invents a price; this enum keeps the invention impossible (#4318).
Variants§
Rate(f64)
The provider publishes a distinct cache-creation rate (per million).
DocumentedAsInputRate(&'static str)
Provider documentation states that cache creation carries no separate charge beyond the ordinary cache-miss input rate, so the miss rate is the published write rate rather than a substitute for a missing one.
The &'static str is the documentation receipt this claim rests on, so
the policy is auditable instead of asserted.
Unpublished
No published cache-write rate was found for this row. A turn that actually wrote to cache fails closed rather than being billed at a rate CodeWhale made up.