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 = []
mounter = []
usbmuxd = []
tcp = ["tokio/net"]
xpc = [
"tokio/full",
"dep:indexmap",
@@ -51,6 +52,7 @@ full = [
"mounter",
"usbmuxd",
"xpc",
"tcp",
]
# Why: https://github.com/rust-lang/cargo/issues/1197

View File

@@ -6,6 +6,7 @@ use std::{
pin::Pin,
};
#[cfg(feature = "tcp")]
use tokio::net::TcpStream;
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>>;
}
#[cfg(feature = "tcp")]
#[derive(Debug)]
pub struct TcpProvider {
pub addr: IpAddr,
@@ -35,6 +37,7 @@ pub struct TcpProvider {
pub label: String,
}
#[cfg(feature = "tcp")]
impl IdeviceProvider for TcpProvider {
fn connect(
&self,