5个不稳定版本

0.3.2 2024年2月12日
0.3.1 2024年2月12日
0.2.0 2023年8月8日
0.1.2 2022年5月3日
0.1.1 2022年4月9日

#1663网络编程

每月 36 次下载
用于 erldash

MIT/Apache

19KB
364

erl_rpc

erl_rpc Documentation Actions Status Coverage Status License

Rust的Erlang RPC客户端。

示例

smol::block_on(async {
    // Connect to an Erlang node.
    let erlang_node = "foo@localhost";
    let cookie = "cookie-value";
    let client = erl_rpc::RpcClient::connect(erlang_node, cookie).await?;
    let mut handle = client.handle();

    // Run the RPC client as a background task.
    smol::spawn(async {
        if let Err(e) = client.run().await {
            eprintln!("RpcClient Error: {}", e);
        }
    }).detach();

    // Execute an RPC: `erlang:processes/0`
    let result = handle
        .call("erlang".into(), "processes".into(), erl_dist::term::List::nil())
        .await?;
    println!("{}", result);
    Ok(())
})

依赖项

~6–15MB
~189K SLoC