mod rpc

module rpc

C API for the RPC client.

Provides rgpot_rpc_client_t — an opaque handle wrapping the async Cap’n Proto RPC client — and functions to connect, calculate, and disconnect.

Types

type rgpot_rpc_client_t

Opaque RPC client handle.

Functions

unsafe extern C fn rgpot_rpc_calculate(client: *mut rgpot_rpc_client_t, input: *const rgpot_force_input_t, output: *mut rgpot_force_out_t) -> rgpot_status_t

Perform a remote force/energy calculation.

Returns RGPOT_SUCCESS on success, or an error status code.

unsafe extern C fn rgpot_rpc_client_free(client: *mut rgpot_rpc_client_t)

Free an RPC client handle.

If client is NULL, this is a no-op.

unsafe extern C fn rgpot_rpc_client_new(host: *const c_char, port: u16) -> *mut rgpot_rpc_client_t

Create a new RPC client connected to host:port.

Returns a heap-allocated handle, or NULL on failure. The caller must eventually call rgpot_rpc_client_free.