pub struct DefaultModelRegistry { /* private fields */ }Expand description
Model registry for managing models and aliases
Implementations§
Source§impl DefaultModelRegistry
impl DefaultModelRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create registry with common aliases
Sourcepub fn register_alias(
&mut self,
alias: impl Into<String>,
target: impl Into<String>,
)
pub fn register_alias( &mut self, alias: impl Into<String>, target: impl Into<String>, )
Register a model alias
Sourcepub fn add_alias(&mut self, alias: ModelAlias) -> Result<()>
pub fn add_alias(&mut self, alias: ModelAlias) -> Result<()>
Add alias from struct
Sourcepub fn resolve_model_id(&self, name: &str) -> String
pub fn resolve_model_id(&self, name: &str) -> String
Resolve model ID through aliases
Sourcepub fn list_aliases(&self) -> Vec<ModelAlias>
pub fn list_aliases(&self) -> Vec<ModelAlias>
List all registered aliases
Sourcepub async fn discover_models(
&mut self,
root: &Path,
) -> Result<Vec<ModelDiscoveryEntry>>
pub async fn discover_models( &mut self, root: &Path, ) -> Result<Vec<ModelDiscoveryEntry>>
Discover models in a directory
Trait Implementations§
Source§impl Debug for DefaultModelRegistry
impl Debug for DefaultModelRegistry
Auto Trait Implementations§
impl Freeze for DefaultModelRegistry
impl RefUnwindSafe for DefaultModelRegistry
impl Send for DefaultModelRegistry
impl Sync for DefaultModelRegistry
impl Unpin for DefaultModelRegistry
impl UnsafeUnpin for DefaultModelRegistry
impl UnwindSafe for DefaultModelRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more