1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # HDC Rust Client Library
//!
//! A Rust implementation of the HarmonyOS Device Connector (HDC) client.
//! This library provides a type-safe, async interface to communicate with HDC servers.
//!
//! ## Features
//!
//! - **Async/await** - Built on Tokio for efficient async I/O
//! - **Device Management** - List, connect, and monitor devices
//! - **Shell Commands** - Execute commands on devices
//! - **Port Forwarding** - TCP, Unix sockets, JDWP, Ark debugger support
//! - **App Management** - Install and uninstall applications (.hap, .hsp)
//! - **File Transfer** - Send and receive files with options
//! - **Log Streaming** - Read device logs (hilog)
//! - **Type-safe API** - Rust's type system ensures correctness
//! - **Error Handling** - Comprehensive error types with context
//!
//! ## Quick Start
//!
//! ```no_run
//! use hdc_rs::HdcClient;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Connect to HDC server
//! let mut client = HdcClient::connect("127.0.0.1:8710").await?;
//!
//! // List connected devices
//! let devices = client.list_targets().await?;
//! println!("Devices: {:?}", devices);
//!
//! if !devices.is_empty() {
//! // Select and connect to first device
//! client.connect_device(&devices[0]).await?;
//!
//! // Execute shell command
//! let output = client.shell("ls -l /data").await?;
//! println!("{}", output);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Module Organization
//!
//! - [`client`] - Main HDC client implementation
//! - [`blocking`] - Synchronous/blocking API (requires `blocking` feature)
//! - [`app`] - Application management types and options
//! - [`file`] - File transfer types and options
//! - [`forward`] - Port forwarding types
//! - [`protocol`] - HDC protocol implementation
//! - [`error`] - Error types
//!
//! ## Blocking API
//!
//! For synchronous contexts or FFI bindings (e.g., PyO3), use the blocking module:
//!
//! ```no_run
//! use hdc_rs::blocking::HdcClient;
//!
//! let mut client = HdcClient::connect("127.0.0.1:8710")?;
//! let devices = client.list_targets()?;
//! println!("Devices: {:?}", devices);
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! ## Examples
//!
//! See the `examples/` directory for comprehensive examples:
//!
//! - `list_devices` - List connected devices
//! - `device_monitor` - Monitor device connections
//! - `simple_shell` - Interactive shell
//! - `forward_demo` - Port forwarding
//! - `file_demo` - File transfer
//! - `app_demo` - App installation
//! - `hilog_demo` - Device logs
//! - `comprehensive` - All features
pub use ;
pub use HdcClient;
pub use ;
pub use ;
pub use ;