lt_rs/alerts/implementations/
torrent_removed.rs

1use crate::{
2    alerts::TorrentRemovedAlert,
3    ffi::alerts::torrent_removed::ffi::torrent_removed_alert_get_info_hashes, info_hash::InfoHash,
4    torrent_handle::TorrentHandle,
5};
6
7impl TorrentRemovedAlert {
8    #[inline(always)]
9    pub fn handle(&self) -> TorrentHandle {
10        self.as_torrent_alert().handle()
11    }
12
13    #[inline(always)]
14    pub fn torrent_name<'a>(&'a self) -> &'a str {
15        self.as_torrent_alert().torrent_name()
16    }
17
18    #[inline(always)]
19    pub fn message(&self) -> String {
20        self.as_torrent_alert().message()
21    }
22
23    /// The info-hash of the torrent that was removed.
24    #[inline(always)]
25    pub fn info_hash(&self) -> InfoHash {
26        let hash = unsafe { torrent_removed_alert_get_info_hashes(self.0) };
27        hash.into()
28    }
29
30    #[inline(always)]
31    pub fn userdata(&self) {
32        unimplemented!()
33    }
34}