Expand description
Detrix Rust Client Library
Debug-on-demand observability for Rust applications. This client enables AI-powered debugging of running Rust processes without code modifications or restarts.
§Quick Start
use detrix_rs::Config;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize client (starts control plane, stays SLEEPING)
detrix_rs::init(Config::default())?;
// Your application code runs normally...
// When debugging is needed, call /detrix/wake on the control plane
// Or programmatically:
// detrix_rs::wake()?;
detrix_rs::shutdown()?;
Ok(())
}§Architecture
The client follows the same pattern as the Python and Go clients:
- SLEEPING: Zero overhead. Only control plane HTTP server running.
- WAKING: Transitional state during wake operation.
- AWAKE: lldb-dap attached, registered with daemon, ready for metrics.
Unlike Python’s debugpy, lldb-dap can be fully stopped on sleep, providing cleaner resource management.
Structs§
- Config
- Configuration for the Detrix client.
- Discover
Response - Daemon discovery response (no auth required)
- Sleep
Response - Response from sleep operation
- Status
Response - Current client status
- TlsConfig
- TLS configuration for daemon communication.
- Wake
Response - Response from wake operation
Enums§
- Client
State - Client state machine state:
- Error
- Error type for Detrix client operations.
- Sleep
Response Status - “sleeping” if the client transitioned from awake to sleeping. “already_sleeping” if the client was already in sleeping state.
- Wake
Response Status - “awake” if the client transitioned from sleeping to awake. “already_awake” if the client was already in awake state.
Functions§
- init
- Initialize the Detrix client.
- shutdown
- Shutdown the client and clean up resources.
- sleep
- Put the client to sleep: stop debugger and unregister from daemon.
- status
- Get the current client status.
- wake
- Wake the client: start debugger and register with daemon.
- wake_
with_ url - Wake the client with a daemon URL override.
Type Aliases§
- Result
- Result type alias for Detrix client operations.