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
9pub mod client;
10pub mod h2_raw;
11pub mod message;
12pub mod rsd;
13
14// Keep the old codec as a compatibility shim (still compiles)
15pub mod codec;
16
17pub use client::XpcClient;
18pub use message::{XpcMessage, XpcValue};
19pub use rsd::{RsdHandshake, ServiceDescriptor};
20
21/// Errors from XPC operations.
22#[derive(Debug, thiserror::Error)]
23pub enum XpcError {
24    #[error("IO error: {0}")]
25    Io(#[from] std::io::Error),
26    #[error("not connected")]
27    NotConnected,
28    #[error("service not found: {0}")]
29    ServiceNotFound(String),
30    #[error("TLS / protocol error: {0}")]
31    Tls(String),
32}