pub struct DownloadId {
model_id: String,
quantization: Option<String>,
}Expand description
Canonical identifier for a download.
Represents a unique download as model_id:quantization (or just model_id if no quantization).
This is the single identifier format used throughout the system.
Fields§
§model_id: String§quantization: Option<String>No skip_serializing_if, so the key is always on the wire — null
when the download names no quantization.
Implementations§
Source§impl DownloadId
impl DownloadId
Sourcepub fn new(
model_id: impl Into<String>,
quantization: Option<impl Into<String>>,
) -> Self
pub fn new( model_id: impl Into<String>, quantization: Option<impl Into<String>>, ) -> Self
Create a new download ID.
Sourcepub fn from_model(model_id: impl Into<String>) -> Self
pub fn from_model(model_id: impl Into<String>) -> Self
Create a download ID from model_id only (no quantization).
Sourcepub fn quantization(&self) -> Option<&str>
pub fn quantization(&self) -> Option<&str>
Get the quantization type if specified (e.g., “Q4_K_M”).
Sourcepub const fn has_quantization(&self) -> bool
pub const fn has_quantization(&self) -> bool
Check if this ID has a quantization specified.
Trait Implementations§
Source§impl Clone for DownloadId
impl Clone for DownloadId
Source§fn clone(&self) -> DownloadId
fn clone(&self) -> DownloadId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DownloadId
impl Debug for DownloadId
Source§impl<'de> Deserialize<'de> for DownloadId
impl<'de> Deserialize<'de> for DownloadId
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
Source§impl Display for DownloadId
impl Display for DownloadId
Source§impl FromStr for DownloadId
impl FromStr for DownloadId
Source§impl Hash for DownloadId
impl Hash for DownloadId
Source§impl PartialEq for DownloadId
impl PartialEq for DownloadId
Source§fn eq(&self, other: &DownloadId) -> bool
fn eq(&self, other: &DownloadId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DownloadId
impl Serialize for DownloadId
impl Eq for DownloadId
impl StructuralPartialEq for DownloadId
Auto Trait Implementations§
impl Freeze for DownloadId
impl RefUnwindSafe for DownloadId
impl Send for DownloadId
impl Sync for DownloadId
impl Unpin for DownloadId
impl UnsafeUnpin for DownloadId
impl UnwindSafe for DownloadId
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