CompletionKey

Enum CompletionKey 

Source
pub enum CompletionKey {
    HfFile {
        repo_id: String,
        revision: String,
        filename_canon: String,
        quantization: Option<String>,
    },
    UrlFile {
        url: String,
        filename: String,
    },
    LocalFile {
        path: String,
    },
}
Expand description

Stable artifact identity for completion tracking.

This key is computed at enqueue time (before download starts) and remains stable across retries, failures, and sharded downloads. It represents “what the user thinks they downloaded” from an artifact perspective, not a request perspective.

§Identity Semantics

  • Same artifact downloaded twice → same key (deduplication)
  • All shards in a group → same key (one entry)
  • Failures before metadata available → key still valid
  • Survives cancellations and retries

Variants§

§

HfFile

HuggingFace model file.

Fields

§repo_id: String

Repository ID (e.g., “unsloth/Llama-3-GGUF”).

§revision: String

Git revision (branch, tag, or commit SHA). Stores exactly what the user requested (e.g., “main”, “v1.0”, or a SHA). Use “unspecified” if no revision was provided.

§filename_canon: String

Canonical filename (normalized for sharded models). Shard suffixes are stripped: “model-00001-of-00008.gguf” → “model.gguf”

§quantization: Option<String>

Quantization type (e.g., “Q4_K_M”). Optional since some downloads may not have a meaningful quantization.

§

UrlFile

File downloaded from URL.

Fields

§url: String

Source URL.

§filename: String

Target filename.

§

LocalFile

Local file operation.

Fields

§path: String

Absolute path to the file.

Trait Implementations§

Source§

impl Clone for CompletionKey

Source§

fn clone(&self) -> CompletionKey

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompletionKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CompletionKey

Source§

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 CompletionKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for CompletionKey

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CompletionKey

Source§

fn eq(&self, other: &CompletionKey) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CompletionKey

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CompletionKey

Source§

impl StructuralPartialEq for CompletionKey

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,