pub struct ProviderIndex { /* private fields */ }Expand description
Immutable provider catalog with O(1) lookup by id.
The catalog is compiled into the binary from catalog.json via include_str!.
Access it through ProviderIndex::embedded().
Implementations§
Source§impl ProviderIndex
impl ProviderIndex
Sourcepub fn embedded() -> &'static ProviderIndex
pub fn embedded() -> &'static ProviderIndex
Access the static catalog embedded at compile time.
Sourcepub fn all(&self) -> &[ServiceDescriptor]
pub fn all(&self) -> &[ServiceDescriptor]
Return all providers in catalog order.
Sourcepub fn get(&self, id: &str) -> Option<&ServiceDescriptor>
pub fn get(&self, id: &str) -> Option<&ServiceDescriptor>
Look up a provider by ID. O(1).
Sourcepub fn categories(&self) -> Vec<String>
pub fn categories(&self) -> Vec<String>
Unique categories in catalog order.
Sourcepub fn providers_by_category(&self, category: &str) -> Vec<&ServiceDescriptor>
pub fn providers_by_category(&self, category: &str) -> Vec<&ServiceDescriptor>
Filter providers by category.
Sourcepub fn builtin_secret_keys(&self) -> HashSet<String>
pub fn builtin_secret_keys(&self) -> HashSet<String>
Collect all secret key variable names from providers that require one.
Sourcepub fn models_for(&self, provider_id: &str) -> &[ModelDescriptor]
pub fn models_for(&self, provider_id: &str) -> &[ModelDescriptor]
Get models for a specific provider.
Sourcepub fn find_model(
&self,
model_id: &str,
) -> Option<(&ServiceDescriptor, &ModelDescriptor)>
pub fn find_model( &self, model_id: &str, ) -> Option<(&ServiceDescriptor, &ModelDescriptor)>
Find a model by ID across all providers. Returns the first match (provider, model).
Trait Implementations§
Source§impl Clone for ProviderIndex
impl Clone for ProviderIndex
Source§fn clone(&self) -> ProviderIndex
fn clone(&self) -> ProviderIndex
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 moreAuto Trait Implementations§
impl Freeze for ProviderIndex
impl RefUnwindSafe for ProviderIndex
impl Send for ProviderIndex
impl Sync for ProviderIndex
impl Unpin for ProviderIndex
impl UnsafeUnpin for ProviderIndex
impl UnwindSafe for ProviderIndex
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