pub struct ModelUri {
pub scheme: UriScheme,
pub name: String,
pub version: Option<String>,
pub hash: Option<String>,
pub host: Option<String>,
pub path: Option<String>,
}Expand description
Parsed model URI
Fields§
§scheme: UriSchemeURI scheme
name: StringModel name or path
version: Option<String>Version reference (semantic version, tag, or hash)
hash: Option<String>Content hash for content-addressed references
host: Option<String>Remote registry host (if specified)
path: Option<String>File path within model (for HuggingFace URIs)
Implementations§
Source§impl ModelUri
impl ModelUri
Sourcepub fn parse(uri: &str) -> Result<Self>
pub fn parse(uri: &str) -> Result<Self>
Parse a URI string into a ModelUri
§Supported formats
pacha://model:versionpacha://host/model:versionpacha://model@sha256:hashfile://path/to/model.ggufhf://org/modelmodel:version(assumes pacha://)./model.gguf(assumes file://)
Sourcepub fn is_local_file(&self) -> bool
pub fn is_local_file(&self) -> bool
Check if this is a local file reference
Sourcepub fn version_or_latest(&self) -> &str
pub fn version_or_latest(&self) -> &str
Get version or default to “latest”
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelUri
impl<'de> Deserialize<'de> for ModelUri
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModelUri
impl StructuralPartialEq for ModelUri
Auto Trait Implementations§
impl Freeze for ModelUri
impl RefUnwindSafe for ModelUri
impl Send for ModelUri
impl Sync for ModelUri
impl Unpin for ModelUri
impl UnsafeUnpin for ModelUri
impl UnwindSafe for ModelUri
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.