pub struct ModelProgress {
pub status: String,
pub completed: Option<u64>,
pub total: Option<u64>,
pub digest: Option<String>,
}Expand description
Progress update for model operations (pull, load, delete).
Used for streaming progress from daemon to CLI during long-running operations.
Fields§
§status: StringCurrent status message (e.g., “downloading”, “verifying”, “extracting”)
completed: Option<u64>Bytes/units completed (optional for indeterminate operations)
total: Option<u64>Total bytes/units (optional for indeterminate operations)
digest: Option<String>Model digest (for pull operations)
Implementations§
Source§impl ModelProgress
impl ModelProgress
Sourcepub fn percentage(&self) -> Option<f64>
pub fn percentage(&self) -> Option<f64>
Calculate completion percentage (0.0 - 100.0). Returns None if total is unknown or zero.
Sourcepub fn indeterminate(status: impl Into<String>) -> Self
pub fn indeterminate(status: impl Into<String>) -> Self
Create a new indeterminate progress (spinner mode).
Sourcepub fn determinate(
status: impl Into<String>,
completed: u64,
total: u64,
) -> Self
pub fn determinate( status: impl Into<String>, completed: u64, total: u64, ) -> Self
Create a determinate progress (progress bar mode).
Sourcepub fn from_pull_progress(p: &PullProgress) -> Self
pub fn from_pull_progress(p: &PullProgress) -> Self
Create from PullProgress (from spn_core/spn_ollama).
Trait Implementations§
Source§impl Clone for ModelProgress
impl Clone for ModelProgress
Source§fn clone(&self) -> ModelProgress
fn clone(&self) -> ModelProgress
Returns a duplicate of the value. Read more
1.0.0 · 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 ModelProgress
impl Debug for ModelProgress
Source§impl<'de> Deserialize<'de> for ModelProgress
impl<'de> Deserialize<'de> for ModelProgress
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
Auto Trait Implementations§
impl Freeze for ModelProgress
impl RefUnwindSafe for ModelProgress
impl Send for ModelProgress
impl Sync for ModelProgress
impl Unpin for ModelProgress
impl UnsafeUnpin for ModelProgress
impl UnwindSafe for ModelProgress
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