pub struct EngineDownloadProgressTracker { /* private fields */ }Expand description
Progress tracker specifically for engine downloads
Implementations§
Source§impl EngineDownloadProgressTracker
impl EngineDownloadProgressTracker
pub fn new() -> Self
Sourcepub async fn start_download(
&self,
engine_id: String,
engine_name: String,
total_bytes: u64,
) -> String
pub async fn start_download( &self, engine_id: String, engine_name: String, total_bytes: u64, ) -> String
Start tracking a new engine download
Sourcepub async fn update_progress(
&self,
engine_id: &str,
bytes_downloaded: u64,
status: EngineDownloadStatus,
error_message: Option<String>,
)
pub async fn update_progress( &self, engine_id: &str, bytes_downloaded: u64, status: EngineDownloadStatus, error_message: Option<String>, )
Update engine download progress
Sourcepub async fn update_status(&self, engine_id: &str, status: EngineDownloadStatus)
pub async fn update_status(&self, engine_id: &str, status: EngineDownloadStatus)
Update download status without changing bytes
Sourcepub async fn get_progress(
&self,
engine_id: &str,
) -> Option<EngineDownloadProgress>
pub async fn get_progress( &self, engine_id: &str, ) -> Option<EngineDownloadProgress>
Get current progress for an engine download
Sourcepub async fn get_active_downloads(&self) -> Vec<EngineDownloadProgress>
pub async fn get_active_downloads(&self) -> Vec<EngineDownloadProgress>
Get all active engine downloads
Sourcepub async fn get_all_downloads(&self) -> Vec<EngineDownloadProgress>
pub async fn get_all_downloads(&self) -> Vec<EngineDownloadProgress>
Get all engine downloads (active and completed)
Sourcepub async fn remove_download(&self, engine_id: &str)
pub async fn remove_download(&self, engine_id: &str)
Remove a completed/failed download from tracking
Sourcepub async fn cancel_download(&self, engine_id: &str) -> bool
pub async fn cancel_download(&self, engine_id: &str) -> bool
Cancel an active download
Sourcepub async fn cleanup_old_downloads(&self, max_age_hours: i64)
pub async fn cleanup_old_downloads(&self, max_age_hours: i64)
Clean up old completed downloads (call periodically)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EngineDownloadProgressTracker
impl !RefUnwindSafe for EngineDownloadProgressTracker
impl Send for EngineDownloadProgressTracker
impl Sync for EngineDownloadProgressTracker
impl Unpin for EngineDownloadProgressTracker
impl UnsafeUnpin for EngineDownloadProgressTracker
impl !UnwindSafe for EngineDownloadProgressTracker
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more