pub struct DownloadQueue {
pub items: Vec<QueueItem>,
pub max_concurrent: u32,
pub stagger_delay_ms: u64,
pub reporter: Option<SharedReporter>,
}Fields§
§items: Vec<QueueItem>§max_concurrent: u32§stagger_delay_ms: u64§reporter: Option<SharedReporter>Implementations§
Source§impl DownloadQueue
impl DownloadQueue
pub fn new(max_concurrent: u32, reporter: Option<SharedReporter>) -> Self
pub fn set_reporter(&mut self, reporter: SharedReporter)
pub fn enqueue( &mut self, id: u64, url: String, platform: String, title: String, output_dir: String, download_mode: Option<String>, quality: Option<String>, format_id: Option<String>, referer: Option<String>, extra_headers: Option<HashMap<String, String>>, page_url: Option<String>, user_agent: Option<String>, media_info: Option<MediaInfo>, total_bytes: Option<u64>, file_count: Option<u32>, downloader: Arc<dyn PlatformDownloader>, ytdlp_path: Option<PathBuf>, from_hotkey: bool, )
pub fn active_count(&self) -> u32
pub fn next_queued_ids(&self) -> Vec<u64>
pub fn mark_active(&mut self, id: u64)
pub fn mark_complete( &mut self, id: u64, success: bool, error: Option<String>, file_path: Option<String>, file_size_bytes: Option<u64>, )
pub fn mark_seeding( &mut self, id: u64, file_path: Option<String>, file_size_bytes: Option<u64>, torrent_id: Option<usize>, )
pub fn update_progress( &mut self, id: u64, percent: f64, speed: f64, downloaded: u64, total: Option<u64>, torrent_id: Option<usize>, )
pub fn pause(&mut self, id: u64) -> bool
pub fn resume(&mut self, id: u64) -> bool
pub fn cancel(&mut self, id: u64) -> (bool, Option<usize>)
pub fn retry(&mut self, id: u64) -> bool
pub fn remove(&mut self, id: u64) -> Option<Option<usize>>
pub fn clear_finished(&mut self)
pub fn get_state(&self) -> Vec<QueueItemInfo>
pub fn has_url(&self, url: &str) -> bool
Auto Trait Implementations§
impl Freeze for DownloadQueue
impl !RefUnwindSafe for DownloadQueue
impl Send for DownloadQueue
impl Sync for DownloadQueue
impl Unpin for DownloadQueue
impl UnsafeUnpin for DownloadQueue
impl !UnwindSafe for DownloadQueue
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