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