diff --git a/idevice/src/lib.rs b/idevice/src/lib.rs index de98071..7b95b0a 100644 --- a/idevice/src/lib.rs +++ b/idevice/src/lib.rs @@ -180,7 +180,7 @@ impl Idevice { /// /// # Errors /// Returns `IdeviceError` if transmission fails - async fn send_raw(&mut self, message: &[u8]) -> Result<(), IdeviceError> { + pub async fn send_raw(&mut self, message: &[u8]) -> Result<(), IdeviceError> { self.send_raw_with_progress(message, |_| async {}, ()).await } @@ -197,7 +197,7 @@ impl Idevice { /// /// # Errors /// Returns `IdeviceError` if transmission fails - async fn send_raw_with_progress( + pub async fn send_raw_with_progress( &mut self, message: &[u8], callback: impl Fn(((usize, usize), S)) -> Fut, @@ -233,7 +233,7 @@ impl Idevice { /// /// # Errors /// Returns `IdeviceError` if reading fails or connection is closed prematurely - async fn read_raw(&mut self, len: usize) -> Result, IdeviceError> { + pub async fn read_raw(&mut self, len: usize) -> Result, IdeviceError> { if let Some(socket) = &mut self.socket { let mut buf = vec![0; len]; socket.read_exact(&mut buf).await?; @@ -253,7 +253,7 @@ impl Idevice { /// /// # Errors /// Returns `IdeviceError` if reading fails - async fn read_any(&mut self, max_size: u32) -> Result, IdeviceError> { + pub async fn read_any(&mut self, max_size: u32) -> Result, IdeviceError> { if let Some(socket) = &mut self.socket { let mut buf = vec![0; max_size as usize]; let len = socket.read(&mut buf).await?; diff --git a/idevice/src/provider.rs b/idevice/src/provider.rs index abd4760..740f6a1 100644 --- a/idevice/src/provider.rs +++ b/idevice/src/provider.rs @@ -3,11 +3,7 @@ //! Provides abstractions for establishing connections to iOS devices through different //! transport mechanisms (TCP, USB, etc.). -use std::{ - future::Future, - net::{IpAddr, SocketAddr}, - pin::Pin, -}; +use std::{future::Future, pin::Pin}; #[cfg(feature = "tcp")] use tokio::net::TcpStream; @@ -51,7 +47,7 @@ pub trait IdeviceProvider: Unpin + Send + Sync + std::fmt::Debug { #[derive(Debug)] pub struct TcpProvider { /// IP address of the device - pub addr: IpAddr, + pub addr: std::net::IpAddr, /// Pairing file for secure communication pub pairing_file: PairingFile, /// Label identifying this connection @@ -74,7 +70,7 @@ impl IdeviceProvider for TcpProvider { let addr = self.addr; let label = self.label.clone(); Box::pin(async move { - let socket_addr = SocketAddr::new(addr, port); + let socket_addr = std::net::SocketAddr::new(addr, port); let stream = TcpStream::connect(socket_addr).await?; Ok(Idevice::new(Box::new(stream), label)) }) @@ -153,4 +149,3 @@ impl IdeviceProvider for UsbmuxdProvider { }) } } - diff --git a/idevice/src/util.rs b/idevice/src/util.rs index 498097b..803352a 100644 --- a/idevice/src/util.rs +++ b/idevice/src/util.rs @@ -2,6 +2,7 @@ //! //! Provides helper functions for working with Apple's Property List (PLIST) format, //! including serialization and pretty-printing utilities. +#![allow(dead_code)] // functions might not be used by all features use plist::Value; @@ -125,4 +126,3 @@ fn print_plist(p: &Value, indentation: usize) -> String { _ => "Unknown".to_string(), } } -