pub fn cancel_all(&mut self) {
        // Replace the pending task list with an empty one and drop it.
        let _ = std::mem::take(&mut self.pending);
        // Signal cancellation to all running tasks.
        // Since we already dropped the JoinHandles above, they should
        // fail silently.
        for (_hash, cancel) in self.cancel_handles.drain() {
            let _ = cancel.send(());
        }
        assert!(self.pending.is_empty());
        assert!(self.cancel_handles.is_empty());
    }
/// Cancel all running tasks and reset the downloader state.
Cancel all running tasks and reset the downloader state.
Cancel all running tasks and reset the downloader state .
pub fn cancel_all(&mut self) {
        // Replace the pending task list with an empty one and drop it.
        let _ = std::mem::take(&mut self.pending);
        // Signal cancellation to all running tasks.
        // Since we already dropped the JoinHandles above, they should
        // fail silently.
        for (_hash, cancel) in self.cancel_handles.drain() {
            let _ = cancel.send(());
        }
        assert!(self.pending.is_empty());
        assert!(self.cancel_handles.is_empty());
    }
pub fn cancel_all ( & mut self ) { // Replace the pending task list with an empty one and drop it. let _ = std :: mem :: take ( & mut self . pending ) ; // Signal cancellation to all running tasks. // Since we already dropped the JoinHandles above, they should // fail silently. for ( _hash , cancel ) in self . cancel_handles . drain ( ) { let _ = cancel . send ( ( ) ) ; } assert ! ( self pending is_empty ( ) ) ; assert ! ( self cancel_handles is_empty ( ) ) ; }
Cancel all running tasks and reset the downloader state.
Cancel all running tasks and reset the downloader state .
&mut self