pub fn schedule(
        &self,
        downloader_id: DownloaderId,
        file_id: FileId,
        start: u64,
        length: usize,
    ) {
        let mut data_guard = self.data.lock().unwrap();
        let file_map = data_guard
            .entry((downloader_id.clone(), file_id.clone()))
            .or_insert_with(|| BTreeMap::new());
        file_map.insert(start, Download::Pending);
        self.tx
            .send((downloader_id, file_id, start, length))
            .unwrap();
    }
/// Add a new chunk to the download queue
Add a new chunk to the download queue
Add a new chunk to the download queue
pub fn schedule(
        &self,
        downloader_id: DownloaderId,
        file_id: FileId,
        start: u64,
        length: usize,
    ) {
        let mut data_guard = self.data.lock().unwrap();
        let file_map = data_guard
            .entry((downloader_id.clone(), file_id.clone()))
            .or_insert_with(|| BTreeMap::new());
        file_map.insert(start, Download::Pending);
        self.tx
            .send((downloader_id, file_id, start, length))
            .unwrap();
    }
pub fn schedule ( & self , downloader_id : DownloaderId , file_id : FileId , start : u64 , length : usize , ) { let mut data_guard = self . data . lock ( ) . unwrap ( ) ; let file_map = data_guard . entry ( ( downloader_id . clone ( ) , file_id . clone ( ) ) ) . or_insert_with ( | | BTreeMap :: new ( ) ) ; file_map . insert ( start , Download :: Pending ) ; self . tx . send ( ( downloader_id , file_id , start , length ) ) . unwrap ( ) ; }
Add a new chunk to the download queue
Add a new chunk to the download queue
&self
downloader_id
DownloaderId
file_id
FileId
start
u64
length
usize
&self
downloader_id
DownloaderId
file_id
FileId
start
u64
length
usize