pub struct IpcClient { /* private fields */ }Expand description
IPC client with connection management and error handling
Implementations§
Source§impl IpcClient
impl IpcClient
Sourcepub fn with_socket_path<P: AsRef<Path>>(socket_path: P) -> Self
pub fn with_socket_path<P: AsRef<Path>>(socket_path: P) -> Self
Create a new IPC client with a custom socket path
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set the timeout for operations
Sourcepub fn with_retry_params(self, max_retries: u32, retry_delay_ms: u64) -> Self
pub fn with_retry_params(self, max_retries: u32, retry_delay_ms: u64) -> Self
Set reconnection parameters
Sourcepub async fn is_daemon_running(&self) -> bool
pub async fn is_daemon_running(&self) -> bool
Check if the daemon is running by attempting to connect to its socket
Sourcepub async fn connect(&self) -> Result<UnixStream, IpcError>
pub async fn connect(&self) -> Result<UnixStream, IpcError>
Connect to the daemon with retry logic
Sourcepub async fn send(&self, request: &Request) -> Result<Response, IpcError>
pub async fn send(&self, request: &Request) -> Result<Response, IpcError>
Send a request to the daemon and wait for a response with reconnection logic
Sourcepub async fn send_with_retries(
&self,
request: &Request,
max_retries: u32,
) -> Result<Response, IpcError>
pub async fn send_with_retries( &self, request: &Request, max_retries: u32, ) -> Result<Response, IpcError>
Send a request with a specific number of retries
Sourcepub async fn set_macro_settings(
&self,
settings: MacroSettings,
) -> Result<(), IpcError>
pub async fn set_macro_settings( &self, settings: MacroSettings, ) -> Result<(), IpcError>
Set global macro settings
Sourcepub async fn get_macro_settings(&self) -> Result<MacroSettings, IpcError>
pub async fn get_macro_settings(&self) -> Result<MacroSettings, IpcError>
Get global macro settings
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IpcClient
impl RefUnwindSafe for IpcClient
impl Send for IpcClient
impl Sync for IpcClient
impl Unpin for IpcClient
impl UnsafeUnpin for IpcClient
impl UnwindSafe for IpcClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more