pub struct ModelCatalog { /* private fields */ }Expand description
Key → model catalog resolved from config.toml. Empty when the user has not configured any models.
Implementations§
Source§impl ModelCatalog
impl ModelCatalog
pub fn new(entries: BTreeMap<String, CatalogModel>) -> Self
Sourcepub fn get(&self, key: &str) -> Result<&CatalogModel, String>
pub fn get(&self, key: &str) -> Result<&CatalogModel, String>
Look up a usable model. Errors are user-actionable: unknown keys list the configured catalog; entries with unresolved credentials report the failing auth source (env var / file).
Sourcepub fn contains(&self, key: &str) -> bool
pub fn contains(&self, key: &str) -> bool
Key exists (regardless of whether its credential resolved).
Sourcepub fn spec(&self, key: &str) -> Option<&ModelSpec>
pub fn spec(&self, key: &str) -> Option<&ModelSpec>
Spec for key, ignoring credential state. For settings that must be
read while merely configuring a run (the image cap host workers are
spawned with) rather than using the model — Self::get is still the
gate for that.
pub fn keys(&self) -> Vec<&str>
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for ModelCatalog
impl Clone for ModelCatalog
Source§fn clone(&self) -> ModelCatalog
fn clone(&self) -> ModelCatalog
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 ModelCatalog
impl Debug for ModelCatalog
Source§impl Default for ModelCatalog
impl Default for ModelCatalog
Source§fn default() -> ModelCatalog
fn default() -> ModelCatalog
Returns the “default value” for a type. Read more
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