lt_rs/alerts/implementations/
add_torrent.rs1use crate::{
2 add_torrent_params::AddTorrentParamsRef,
3 alerts::AddTorrentAlert,
4 errors::LtrsError,
5 ffi::alerts::add_torrent::ffi::{
6 add_torrent_alert_get_add_torrent_params, add_torrent_alert_get_error,
7 },
8 torrent_handle::TorrentHandle,
9};
10
11impl AddTorrentAlert {
12 #[inline(always)]
13 pub fn handle(&self) -> TorrentHandle {
14 self.as_torrent_alert().handle()
15 }
16
17 #[inline(always)]
18 pub fn torrent_name<'a>(&'a self) -> &'a str {
19 self.as_torrent_alert().torrent_name()
20 }
21
22 #[inline(always)]
23 pub fn message(&self) -> String {
24 self.as_torrent_alert().message()
25 }
26
27 #[inline(always)]
39 pub fn params<'a>(&'a self) -> AddTorrentParamsRef<'a> {
40 unsafe { add_torrent_alert_get_add_torrent_params(self.0) }.into()
41 }
42
43 #[inline(always)]
44 pub fn error(&self) -> LtrsError {
45 unsafe { add_torrent_alert_get_error(self.0) }.into()
46 }
47}