mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Move Tokio tcp to feature
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user