@@ -23,7 +23,7 @@ const TOTAL_REQUEST_TIMEOUT_IN_SECS: u64 = 5;
2323pub struct Client {
2424 pub connection_info : ConnectionInfo ,
2525 api_base_url : Url ,
26- client : reqwest:: Client ,
26+ http : reqwest:: Client ,
2727 token_param : [ ( String , String ) ; 1 ] ,
2828}
2929
@@ -45,7 +45,7 @@ impl Client {
4545 Ok ( Self {
4646 connection_info,
4747 api_base_url,
48- client,
48+ http : client,
4949 token_param,
5050 } )
5151 }
@@ -58,7 +58,7 @@ impl Client {
5858 pub async fn whitelist_torrent ( & self , info_hash : & str ) -> Result < Response , Error > {
5959 let request_url = format ! ( "{}/whitelist/{}" , self . api_base_url, info_hash) ;
6060
61- self . client . post ( request_url) . query ( & self . token_param ) . send ( ) . await
61+ self . http . post ( request_url) . query ( & self . token_param ) . send ( ) . await
6262 }
6363
6464 /// Remove a torrent from the tracker whitelist.
@@ -69,7 +69,7 @@ impl Client {
6969 pub async fn remove_torrent_from_whitelist ( & self , info_hash : & str ) -> Result < Response , Error > {
7070 let request_url = format ! ( "{}/whitelist/{}" , self . api_base_url, info_hash) ;
7171
72- self . client . delete ( request_url) . query ( & self . token_param ) . send ( ) . await
72+ self . http . delete ( request_url) . query ( & self . token_param ) . send ( ) . await
7373 }
7474
7575 /// Retrieve a new tracker key.
@@ -80,7 +80,7 @@ impl Client {
8080 pub async fn retrieve_new_tracker_key ( & self , token_valid_seconds : u64 ) -> Result < Response , Error > {
8181 let request_url = format ! ( "{}/key/{}" , self . api_base_url, token_valid_seconds) ;
8282
83- self . client . post ( request_url) . query ( & self . token_param ) . send ( ) . await
83+ self . http . post ( request_url) . query ( & self . token_param ) . send ( ) . await
8484 }
8585
8686 /// Retrieve the info for one torrent.
@@ -91,7 +91,7 @@ impl Client {
9191 pub async fn get_torrent_info ( & self , info_hash : & str ) -> Result < Response , Error > {
9292 let request_url = format ! ( "{}/torrent/{}" , self . api_base_url, info_hash) ;
9393
94- self . client . get ( request_url) . query ( & self . token_param ) . send ( ) . await
94+ self . http . get ( request_url) . query ( & self . token_param ) . send ( ) . await
9595 }
9696
9797 /// Retrieve the info for multiple torrents at the same time.
@@ -110,6 +110,6 @@ impl Client {
110110 query_params. push ( ( "info_hash" . to_string ( ) , info_hash. clone ( ) ) ) ;
111111 }
112112
113- self . client . get ( request_url) . query ( & query_params) . send ( ) . await
113+ self . http . get ( request_url) . query ( & query_params) . send ( ) . await
114114 }
115115}
0 commit comments