pub struct ModelRegistry { /* private fields */ }Expand description
Registry of available models and their local paths.
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
pub fn new(models_dir: PathBuf) -> Self
Sourcepub fn list_models(&self) -> Vec<ModelInfo>
pub fn list_models(&self) -> Vec<ModelInfo>
List all models with their download status.
Sourcepub async fn ensure_model(&self, name: &str) -> Result<PathBuf, InferenceError>
pub async fn ensure_model(&self, name: &str) -> Result<PathBuf, InferenceError>
Ensure a model is downloaded, returning its local directory path.
Sourcepub fn remove_model(&self, name: &str) -> Result<(), InferenceError>
pub fn remove_model(&self, name: &str) -> Result<(), InferenceError>
Remove a downloaded model.
Auto Trait Implementations§
impl Freeze for ModelRegistry
impl RefUnwindSafe for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
impl UnwindSafe 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
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