Use opaque handle for readwrite objects

This commit is contained in:
Jackson Coxson
2025-05-26 16:34:15 -06:00
parent bc6a1c0503
commit b8e2b115a5
6 changed files with 134 additions and 24 deletions

View File

@@ -42,7 +42,7 @@ pub mod util;
pub use errors::*;
pub use pairing_file::*;
use idevice::{Idevice, IdeviceSocket};
use idevice::{Idevice, IdeviceSocket, ReadWrite};
use once_cell::sync::Lazy;
use std::ffi::{CStr, CString, c_char};
use tokio::runtime::{self, Runtime};
@@ -57,6 +57,11 @@ static RUNTIME: Lazy<Runtime> = Lazy::new(|| {
pub const LOCKDOWN_PORT: u16 = 62078;
#[repr(C)]
pub struct ReadWriteOpaque {
pub inner: Option<Box<dyn ReadWrite>>,
}
/// Opaque C-compatible handle to an Idevice connection
pub struct IdeviceHandle(pub Idevice);
pub struct IdeviceSocketHandle(IdeviceSocket);