pub struct ModelResolver { /* private fields */ }Expand description
Model resolver that handles URI resolution to model data
Implementations§
Source§impl ModelResolver
impl ModelResolver
Sourcepub fn new_default() -> Result<Self>
pub fn new_default() -> Result<Self>
Create a resolver with the default registry location (~/.pacha)
Sourcepub fn new(registry_path: impl AsRef<Path>) -> Result<Self>
pub fn new(registry_path: impl AsRef<Path>) -> Result<Self>
Create a resolver with a custom registry path
Sourcepub fn with_remote_auth(self, auth: RegistryAuth) -> Self
pub fn with_remote_auth(self, auth: RegistryAuth) -> Self
Set remote authentication for resolving pacha:// URIs with hosts
Sourcepub fn has_registry(&self) -> bool
pub fn has_registry(&self) -> bool
Check if registry is available
Sourcepub fn has_remote_auth(&self) -> bool
pub fn has_remote_auth(&self) -> bool
Check if remote authentication is configured
Sourcepub fn resolve(&self, uri: &ModelUri) -> Result<ResolvedModel>
pub fn resolve(&self, uri: &ModelUri) -> Result<ResolvedModel>
Resolve a URI to model data
Sourcepub fn resolve_str(&self, uri: &str) -> Result<ResolvedModel>
pub fn resolve_str(&self, uri: &str) -> Result<ResolvedModel>
Resolve a URI string to model data
Sourcepub fn list_models(&self) -> Result<Vec<String>>
pub fn list_models(&self) -> Result<Vec<String>>
List all models in the local registry
Sourcepub fn list_versions(&self, model_name: &str) -> Result<Vec<ModelVersion>>
pub fn list_versions(&self, model_name: &str) -> Result<Vec<ModelVersion>>
List versions of a model
Auto Trait Implementations§
impl !Freeze for ModelResolver
impl !RefUnwindSafe for ModelResolver
impl !Sync for ModelResolver
impl !UnwindSafe for ModelResolver
impl Send for ModelResolver
impl Unpin for ModelResolver
impl UnsafeUnpin for ModelResolver
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