diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-09-20 21:39:52 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-09-20 23:34:16 +0800 |
| commit | 9c06520622ccc9662fd97a8e0457bc03b4dc4db6 (patch) | |
| tree | 57b546735c9a953360af89220ff12b9ecabb0371 /src/client | |
| parent | 002be6a430d92be930b0e2164f373672c8b7ae83 (diff) | |
wip
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/connector.rs | 4 | ||||
| -rw-r--r-- | src/client/connector/httpconnector.rs | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/client/connector.rs b/src/client/connector.rs index f57e388..f48b039 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -7,7 +7,7 @@ use std::{ }; use crate::client::Client; -use remote_control_rs::{executor::Executor, tasks::NETWORK_T}; +use remote_control_rs::{executor::Executor, tasks::client::NETWORK_T}; pub type Result<T: Display, E: Debug> = result::Result<T, E>; @@ -28,7 +28,7 @@ pub trait Connection { fn get_ip(&self) -> Option<IpAddr>; fn force_network(&mut self) { - _ = Executor::new(&NETWORK_T, ["true"]); + _ = Executor::new(NETWORK_T.as_ref(), ["true"]); } fn init<'a>(&self, c: &Client<'a, Self>) -> std::result::Result<(), Self::Err> diff --git a/src/client/connector/httpconnector.rs b/src/client/connector/httpconnector.rs index 60405f4..eb5ebe3 100644 --- a/src/client/connector/httpconnector.rs +++ b/src/client/connector/httpconnector.rs @@ -1,5 +1,6 @@ use crate::connector::Connection; -use remote_control_rs::{executor::Executor, tasks::NETWORK_T}; +use remote_control_rs::executor::Executor; +use remote_control_rs::tasks::client::{NETWORK_T, Name}; use reqwest::{ Error, StatusCode, Url, blocking::{Client, RequestBuilder}, @@ -25,7 +26,7 @@ impl From<reqwest::Error> for HTTPConnectorError { } pub struct HTTPConnector { - network_enforcer: Executor<'static, 'static>, + network_enforcer: Executor<'static, 'static, Name>, pull_url: Url, ntfy_url: Url, ip_getter_url: Url, @@ -36,7 +37,7 @@ pub struct HTTPConnector { impl HTTPConnector { pub fn new(pull_url: &str, ntfy_url: &str, ip_getter_url: &str) -> result::Result<Self, HTTPConnectorError> { Ok(Self { - network_enforcer: Executor::new(&NETWORK_T, ["true"]).unwrap(), // .unwrap() should never panic + network_enforcer: Executor::new(NETWORK_T.as_ref(), ["true"]).unwrap(), // .unwrap() should never panic prev: String::new(), pull_url: Url::parse(pull_url)?, ntfy_url: Url::parse(ntfy_url)?, |
