QueuedDownload

Struct QueuedDownload 

Source
pub struct QueuedDownload {
Show 15 fields pub id: String, pub model_id: String, pub quantization: Option<Quantization>, pub display_name: String, pub status: DownloadStatus, pub position: u32, pub downloaded_bytes: u64, pub total_bytes: u64, pub speed_bps: f64, pub eta_seconds: Option<f64>, pub progress_percent: f64, pub queued_at: u64, pub started_at: Option<u64>, pub group_id: Option<String>, pub shard_info: Option<ShardInfo>,
}
Expand description

A single download in the queue.

Fields§

§id: String

Canonical ID (model_id:quantization or model_id).

§model_id: String

Full model ID (e.g., “TheBloke/Llama-2-7B-GGUF”).

§quantization: Option<Quantization>

Resolved quantization (if specified).

§display_name: String

Human-readable display name.

§status: DownloadStatus

Current status.

§position: u32

Position in queue (1-based; 1 = active, 2+ = waiting).

§downloaded_bytes: u64

Bytes downloaded so far.

§total_bytes: u64

Total bytes to download.

§speed_bps: f64

Download speed in bytes per second.

§eta_seconds: Option<f64>

Estimated time remaining.

§progress_percent: f64

Progress as percentage (0.0 - 100.0).

§queued_at: u64

Timestamp when download was queued (Unix epoch seconds).

§started_at: Option<u64>

Timestamp when download started (Unix epoch seconds).

§group_id: Option<String>

Group ID for sharded downloads.

§shard_info: Option<ShardInfo>

Shard information if this is part of a sharded download.

Implementations§

Source§

impl QueuedDownload

Source

pub fn new( id: impl Into<String>, model_id: impl Into<String>, display_name: impl Into<String>, position: u32, queued_at: u64, ) -> Self

Create a new queued download in initial state.

Source

pub const fn with_quantization(self, quant: Quantization) -> Self

Set the quantization.

Source

pub const fn with_status(self, status: DownloadStatus) -> Self

Set the download status.

Source

pub fn with_shard_info(self, group_id: String, shard_info: ShardInfo) -> Self

Set shard information.

Source

pub fn update_progress(&mut self, downloaded: u64, total: u64, speed_bps: f64)

Update progress from bytes downloaded.

Source

pub fn is_active(&self) -> bool

Check if this download is currently active.

Source

pub const fn is_complete(&self) -> bool

Check if this download is complete.

Source

pub fn speed_display(&self) -> String

Get formatted speed string (e.g., “5.2 MB/s”).

Source

pub fn eta_display(&self) -> Option<String>

Get formatted ETA string (e.g., “2m 30s”).

Trait Implementations§

Source§

impl Clone for QueuedDownload

Source§

fn clone(&self) -> QueuedDownload

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 QueuedDownload

Source§

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

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

impl<'de> Deserialize<'de> for QueuedDownload

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 Serialize for QueuedDownload

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

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, 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>,