ensure_daemon_running

Function ensure_daemon_running 

Source
pub fn ensure_daemon_running(manifest_path: Option<&Path>) -> Result<()>
Expand description

Ensure the daemon is running, starting it if necessary.

This function will:

  1. Check if a daemon is already running
  2. If not, attempt to start one using bronzite-daemon --ensure
  3. 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