Skip to main content

send

Function send 

Source
pub async fn send(request: &Request) -> Result<Response, IpcError>
Expand description

Send a request to the daemon using the default client

§Arguments

  • request - The request to send to the daemon

§Returns

Returns the response from the daemon or an IpcError if communication fails

§Example

use aethermap_common::{ipc_client, Request};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let response = ipc_client::send(&Request::GetDevices).await?;
    println!("Got response: {:?}", response);
    Ok(())
}