Trait Pricing Source

View as MarkdownOpen in Claude

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

pub trait PricingSource: Send + Sync {
    // Required methods
    fn source_name(&self) -> &str;
    fn load_catalog(
        &self,
    ) -> Result<Option<PricingCatalog>, PricingCatalogError>;
}

Pluggable pricing source interface.

Database, service-backed, or enterprise-managed pricing integrations should implement this trait and return a validated catalog snapshot. The LLM hot path uses PricingResolver, so sources can refresh out-of-band without making each response decode perform network or database I/O.

Required Methods

source_name

fn source_name(&self) -> &str

Stable source name for diagnostics.

load_catalog

fn load_catalog(&self) -> Result<Option<PricingCatalog>, PricingCatalogError>

Loads a catalog snapshot from this source.

Implementors