Move Tokio tcp to feature

This commit is contained in:
Jackson Coxson
2025-02-01 16:13:52 -07:00
parent b1a91682a8
commit 646f85c60e
2 changed files with 5 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ heartbeat = []
installation_proxy = [] installation_proxy = []
mounter = [] mounter = []
usbmuxd = [] usbmuxd = []
tcp = ["tokio/net"]
xpc = [ xpc = [
"tokio/full", "tokio/full",
"dep:indexmap", "dep:indexmap",
@@ -51,6 +52,7 @@ full = [
"mounter", "mounter",
"usbmuxd", "usbmuxd",
"xpc", "xpc",
"tcp",
] ]
# Why: https://github.com/rust-lang/cargo/issues/1197 # Why: https://github.com/rust-lang/cargo/issues/1197

View File

@@ -6,6 +6,7 @@ use std::{
pin::Pin, pin::Pin,
}; };
#[cfg(feature = "tcp")]
use tokio::net::TcpStream; use tokio::net::TcpStream;
use crate::{pairing_file::PairingFile, Idevice, IdeviceError}; use crate::{pairing_file::PairingFile, Idevice, IdeviceError};
@@ -28,6 +29,7 @@ pub trait IdeviceProvider: Unpin + Send + Sync + std::fmt::Debug {
) -> Pin<Box<dyn Future<Output = Result<PairingFile, IdeviceError>> + Send>>; ) -> Pin<Box<dyn Future<Output = Result<PairingFile, IdeviceError>> + Send>>;
} }
#[cfg(feature = "tcp")]
#[derive(Debug)] #[derive(Debug)]
pub struct TcpProvider { pub struct TcpProvider {
pub addr: IpAddr, pub addr: IpAddr,
@@ -35,6 +37,7 @@ pub struct TcpProvider {
pub label: String, pub label: String,
} }
#[cfg(feature = "tcp")]
impl IdeviceProvider for TcpProvider { impl IdeviceProvider for TcpProvider {
fn connect( fn connect(
&self, &self,