pub async fn send_command_with_autospawn<Cmd, Resp>(
config: &DaemonClientConfig,
command: &Cmd,
) -> Result<Resp, PluginError>where
Cmd: Serialize,
Resp: for<'de> Deserialize<'de>,Expand description
Send a command to the daemon with automatic spawning if not running
This implements the retry-with-autospawn pattern:
- Try to connect to the daemon
- If connection fails, spawn the daemon
- Wait for startup, then retry connection
- Send command and receive response
§Type Parameters
Cmd- The command type (must be serializable)Resp- The response type (must be deserializable)
§Arguments
config- Configuration for the daemon clientcommand- The command to send
§Returns
The response from the daemon, or an error if communication fails