lt_rs/alerts/implementations/
storage_moved.rs

1use crate::alerts::StorageMovedAlert;
2use crate::ffi::alerts::storage_moved::ffi::{
3    storage_moved_alert_get_old_path, storage_moved_alert_get_storage_path,
4};
5use crate::torrent_handle::TorrentHandle;
6
7impl StorageMovedAlert {
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    #[inline(always)]
24    pub fn storage_path<'a>(&'a self) -> &'a str {
25        unsafe { storage_moved_alert_get_storage_path(self.0) }
26    }
27
28    #[inline(always)]
29    pub fn old_path<'a>(&'a self) -> &'a str {
30        unsafe { storage_moved_alert_get_old_path(self.0) }
31    }
32}