pub fn register_downloader<F>(&self, downloader_id: &str, downloader_creator: F)
    where
        F: Fn() -> Arc<dyn Downloader>,
    {
        let mut dls_guard = self.downloaders.lock().unwrap();
        let current = dls_guard.get(downloader_id);
        if current.is_none() {
            dls_guard.insert(downloader_id.to_owned(), downloader_creator());
        }
    }
/// Registers a new downloader for the given id if necessary
Registers a new downloader for the given id if necessary
Registers a new downloader for the given id if necessary
pub fn register_downloader<F>(&self, downloader_id: &str, downloader_creator: F)
    where
        F: Fn() -> Arc<dyn Downloader>,
    {
        let mut dls_guard = self.downloaders.lock().unwrap();
        let current = dls_guard.get(downloader_id);
        if current.is_none() {
            dls_guard.insert(downloader_id.to_owned(), downloader_creator());
        }
    }
pub fn register_downloader < F > ( & self , downloader_id : & str , downloader_creator : F ) where F : Fn ( ) -> Arc < dyn Downloader > , { let mut dls_guard = self . downloaders . lock ( ) . unwrap ( ) ; let current = dls_guard . get ( downloader_id ) ; if current . is_none ( ) { dls_guard . insert ( downloader_id . to_owned ( ) , downloader_creator ( ) ) ; } }
Registers a new downloader for the given id if necessary
Registers a new downloader for the given id if necessary
&self
downloader_id
&str
downloader_creator
F
&self
downloader_id
&str
downloader_creator
F