2/n Add pause/start actions
This commit is contained in:
parent
0c4844f534
commit
b79a21179f
3 changed files with 19 additions and 16 deletions
|
|
@ -201,8 +201,11 @@ impl Session {
|
|||
self.dht.as_ref()
|
||||
}
|
||||
|
||||
pub fn with_torrents<R>(&self, callback: impl Fn(&[ManagedTorrentHandle]) -> R) -> R {
|
||||
callback(&self.locked.read().torrents)
|
||||
pub fn with_torrents<R>(
|
||||
&self,
|
||||
callback: impl Fn(&mut dyn Iterator<Item = (TorrentId, &ManagedTorrentHandle)>) -> R,
|
||||
) -> R {
|
||||
callback(&mut self.locked.read().torrents.iter().enumerate())
|
||||
}
|
||||
|
||||
pub async fn add_torrent(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue