pub fn ensure_daemon_running(manifest_path: Option<&Path>) -> Result<()>Expand description
Ensure the daemon is running, starting it if necessary.
This function will:
- Check if a daemon is already running
- If not, attempt to start one using
bronzite-daemon --ensure - Wait for the daemon to become ready
This is the recommended way for proc-macros to ensure they can connect.
§Arguments
manifest_path- Optional path to the workspace/crate. If None, uses current directory.
§Example
ⓘ
use bronzite_client::ensure_daemon_running;
// In your proc-macro:
ensure_daemon_running(None)?;
let mut client = bronzite_client::connect()?;
// ... use client