pub fn init(config: Config) -> Result<()>Expand description
Initialize the Detrix client.
This starts the control plane HTTP server but does NOT contact the daemon. The client starts in SLEEPING state with zero overhead.
§Configuration
Configuration can be provided via the Config struct or environment variables:
DETRIX_NAME- Connection nameDETRIX_DAEMON_URL- Daemon URLDETRIX_CONTROL_HOST- Control plane bind hostDETRIX_CONTROL_PORT- Control plane portDETRIX_DEBUG_PORT- Debug adapter portDETRIX_LLDB_DAP_PATH- Path to lldb-dap binaryDETRIX_HOME- Detrix home directoryDETRIX_HEALTH_CHECK_TIMEOUT- Health check timeout (seconds, e.g. “2.0”)DETRIX_REGISTER_TIMEOUT- Registration timeout (seconds, e.g. “5.0”)DETRIX_UNREGISTER_TIMEOUT- Unregistration timeout (seconds, e.g. “2.0”)
§Errors
Returns an error if:
- Client is already initialized
- lldb-dap binary not found
- Failed to start control plane
§Example
use detrix_rs::{self, Config};
detrix_rs::init(Config {
name: Some("my-service".to_string()),
..Config::default()
})?;