pub struct ModelRegistry { /* private fields */ }Expand description
Immutable reference registry for a fixed runtime provider generation.
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn new(
providers: impl IntoIterator<Item = Arc<dyn ModelProvider>>,
) -> Result<Self, ModelRegistryError>
pub fn new( providers: impl IntoIterator<Item = Arc<dyn ModelProvider>>, ) -> Result<Self, ModelRegistryError>
Builds a validated registry from one immutable provider generation.
§Errors
Returns an error for duplicate provider identities or a provider that advertises a model owned by another provider.
Sourcepub fn provider_count(&self) -> usize
pub fn provider_count(&self) -> usize
Returns the registered provider count.
Sourcepub fn provider_ids(&self) -> Vec<ProviderId>
pub fn provider_ids(&self) -> Vec<ProviderId>
Returns registered provider identities in canonical order.
Trait Implementations§
Source§impl Debug for ModelRegistry
impl Debug for ModelRegistry
Source§impl ModelRouter for ModelRegistry
impl ModelRouter for ModelRegistry
Source§fn provider(&self, provider_id: &ProviderId) -> Option<&dyn ModelProvider>
fn provider(&self, provider_id: &ProviderId) -> Option<&dyn ModelProvider>
Returns the provider registered under the canonical identity.
Auto Trait Implementations§
impl !RefUnwindSafe for ModelRegistry
impl !UnwindSafe for ModelRegistry
impl Freeze for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
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