Skip to main content

ios_core/xpc/
mod.rs

1//! XPC binary protocol over HTTP/2 for iOS 17+ service connections.
2//!
3//! Architecture:
4//!   h2_raw   – minimal raw HTTP/2 framer (streams 1 + 3)
5//!   message  – XPC binary message encode/decode
6//!   rsd      – RSD handshake (service discovery)
7//!   client   – High-level XpcClient
8
9#[cfg(feature = "tunnel")]
10pub mod client;
11#[cfg(any(
12    feature = "tunnel",
13    feature = "dproxy",
14    feature = "fetchsymbols",
15    feature = "restore"
16))]
17pub mod h2_raw;
18pub mod message;
19pub mod rsd;
20
21#[cfg(feature = "tunnel")]
22pub use client::XpcClient;
23#[cfg(any(
24    feature = "apps",
25    feature = "deviceinfo",
26    feature = "diagnosticsservice",
27    feature = "dproxy",
28    feature = "fetchsymbols",
29    feature = "fileservice",
30    feature = "restore"
31))]
32pub(crate) use message::{XpcMessage, XpcValue};
33
34/// Errors from XPC operations.
35#[derive(Debug, thiserror::Error)]
36pub enum XpcError {
37    #[error("IO error: {0}")]
38    Io(#[from] std::io::Error),
39    #[error("not connected")]
40    NotConnected,
41    #[error("service not found: {0}")]
42    ServiceNotFound(String),
43    #[error("TLS / protocol error: {0}")]
44    Tls(String),
45}