mod client

module client

Async RPC client wrapping Cap’n Proto Potential.calculate().

The client owns a tokio runtime so that the C API can call it synchronously.

DLPack Integration

Input tensors are read from DLManagedTensorVersioned pointers (CPU only for RPC — GPU tensors would need a device-to-host copy first). The response forces are wrapped in an owning DLPack tensor so the caller can free them via rgpot_tensor_free.

Structs and Unions

struct RpcClient

RPC client that connects to a remote rgpot server.

Implementations

impl RpcClient

Functions

fn calculate(&mut self, input: &rgpot_force_input_t, output: &mut rgpot_force_out_t) -> Result<(), String>

Perform a synchronous RPC calculation.

Internally this blocks on the tokio runtime with a LocalSet (required because capnp_rpc::RpcSystem is !Send).

fn new(host: &str, port: u16) -> Result<Self, String>

Create a new RPC client targeting host:port.

The connection is established lazily on the first calculate call.