dscode_dap/lib.rs
1//! # dscode-dap
2//!
3//! Debug Adapter Protocol client, manager, and pool for DSCode.
4//!
5//! This crate provides a complete DAP client implementation with:
6
7#![warn(missing_docs)]
8#![deny(rustdoc::broken_intra_doc_links)]
9#![warn(dead_code)]
10//! - [`DebugAdapter`] — State-machine-based DAP client that manages a debug adapter process
11//! - [`DebugManager`] — Registry for debug sessions and breakpoints
12//! - [`DebugAdapterPool`] — Connection pool with one adapter per debug session
13//!
14//! # State Machine
15//!
16//! The `DebugAdapter` follows a strict lifecycle:
17//!
18//! ```text
19//! Stopped → Starting → Initializing → Configured → Running
20//! ▲ │ │ │ │
21//! │ ▼ ▼ ▼ ▼
22//! │ Crashed ◄── Crashed ◄─── Crashed ◄── Crashed
23//! │ │
24//! │ ShuttingDown│
25//! │ │ │
26//! └───────────────────────────────────────────┘ │
27//! ▲ │
28//! └───────┘
29//! ```
30//!
31//! # Example
32//!
33//! ```rust,no_run
34//! use dscode_dap::{DebugAdapterPool, DebugManager, DebugSession, DebugState};
35//!
36//! # async fn example() {
37//! let manager = DebugManager::new();
38//! let session_id = manager.create_session("main".to_string(), "cppdbg".to_string()).unwrap();
39//!
40//! let pool = DebugAdapterPool::new();
41//! pool.register_adapter("cppdbg".to_string(), "/usr/bin/gdb".to_string(), vec![]).await;
42//!
43//! let session = manager.get_session(&session_id).unwrap();
44//! let adapter = pool.create_session(session).await.unwrap();
45//! # }
46//! ```
47
48mod adapter;
49mod error;
50mod manager;
51mod pool;
52mod types;
53
54pub use adapter::{DebugAdapter, DebugAdapterState};
55pub use error::DapError;
56pub use manager::DebugManager;
57pub use pool::{DebugAdapterPool, DebugPoolStats};
58pub use types::*;