pub trait DaemonClient: Send + Sync {
// Required methods
fn call(
&mut self,
method: &str,
params: Option<Value>,
) -> Result<Value, ClientError>;
fn call_with_config(
&mut self,
method: &str,
params: Option<Value>,
config: &DaemonClientConfig,
) -> Result<Value, ClientError>;
fn call_with_retry(
&mut self,
method: &str,
params: Option<Value>,
max_retries: u32,
) -> Result<Value, ClientError>;
}Expand description
Trait for daemon client implementations.
This trait abstracts the communication with the daemon, allowing for different transport implementations (Unix socket, mock for testing, etc.).
Required Methods§
Sourcefn call(
&mut self,
method: &str,
params: Option<Value>,
) -> Result<Value, ClientError>
fn call( &mut self, method: &str, params: Option<Value>, ) -> Result<Value, ClientError>
Make an RPC call to the daemon.
Sourcefn call_with_config(
&mut self,
method: &str,
params: Option<Value>,
config: &DaemonClientConfig,
) -> Result<Value, ClientError>
fn call_with_config( &mut self, method: &str, params: Option<Value>, config: &DaemonClientConfig, ) -> Result<Value, ClientError>
Make an RPC call with custom configuration.
Sourcefn call_with_retry(
&mut self,
method: &str,
params: Option<Value>,
max_retries: u32,
) -> Result<Value, ClientError>
fn call_with_retry( &mut self, method: &str, params: Option<Value>, max_retries: u32, ) -> Result<Value, ClientError>
Make an RPC call with retry logic.