pub struct ModelCatalog { /* private fields */ }Expand description
In-memory model-metadata catalog, built once from the embedded TOML.
Implementations§
Source§impl ModelCatalog
impl ModelCatalog
Sourcepub fn parse(toml_text: &str) -> Result<Self, Error>
pub fn parse(toml_text: &str) -> Result<Self, Error>
Parse a catalog from TOML text (exposed for tests). Rejects a duplicate
(provider, model) so a bad edit fails loudly (the embedded catalog is
validated by model_catalog()’s expect + a unit test), mirroring the
uniqueness PricingCatalog gets for free from its keyed map.
Sourcepub fn for_provider(&self, provider: &str) -> Vec<ModelInfo>
pub fn for_provider(&self, provider: &str) -> Vec<ModelInfo>
All models for provider, in file order.
Sourcepub fn model_info(&self, provider: &str, model: &str) -> Option<ModelInfo>
pub fn model_info(&self, provider: &str, model: &str) -> Option<ModelInfo>
Metadata for an exact (provider, model).
pub fn all(&self) -> &[ModelInfo]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelCatalog
impl RefUnwindSafe for ModelCatalog
impl Send for ModelCatalog
impl Sync for ModelCatalog
impl Unpin for ModelCatalog
impl UnsafeUnpin for ModelCatalog
impl UnwindSafe for ModelCatalog
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