pub struct PricingTable { /* private fields */ }Expand description
A pricing lookup layering optional runtime overrides over the embedded
SNAPSHOT. Pure and owned — no global state (CLAUDE.md §9). The binary builds
one (from the --refresh-pricing cache / config) and threads it into the
analysis passes; PricingTable::embedded is byte-for-byte identical to the
free lookup / cost_usd, so an empty table never changes a number.
Implementations§
Source§impl PricingTable
impl PricingTable
Sourcepub fn with_overrides(overrides: Vec<(String, ModelPricing)>) -> Self
pub fn with_overrides(overrides: Vec<(String, ModelPricing)>) -> Self
Snapshot plus the given overrides (keys lower-cased to match
[normalize_model]). Overrides take precedence over the snapshot.
Sourcepub fn override_count(&self) -> usize
pub fn override_count(&self) -> usize
Number of override entries (for the refresh report).
Sourcepub fn lookup(&self, model: &str) -> Option<&ModelPricing>
pub fn lookup(&self, model: &str) -> Option<&ModelPricing>
Look up a model: overrides first (longest-prefix wins), else the embedded
snapshot. None is still surfaced for unknown models, never guessed.
Trait Implementations§
Source§impl Clone for PricingTable
impl Clone for PricingTable
Source§fn clone(&self) -> PricingTable
fn clone(&self) -> PricingTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PricingTable
impl Debug for PricingTable
Source§impl Default for PricingTable
impl Default for PricingTable
Source§fn default() -> PricingTable
fn default() -> PricingTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PricingTable
impl RefUnwindSafe for PricingTable
impl Send for PricingTable
impl Sync for PricingTable
impl Unpin for PricingTable
impl UnsafeUnpin for PricingTable
impl UnwindSafe for PricingTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more