mod server

module server

Cap’n Proto RPC server that dispatches incoming calculate calls to a rgpot_potential_t callback.

DLPack Integration

Incoming data is deserialized from Cap’n Proto into owned Vec values, then wrapped in non-owning DLPack tensors for the callback. The callback’s output forces (an owning DLPack tensor) are read back and serialized into the Cap’n Proto response.

Functions

unsafe extern C fn rgpot_rpc_server_start(pot: *const rgpot_potential_t, host: *const std::os::raw::c_char, port: u16) -> rgpot_status_t

Start an RPC server listening on host:port, dispatching to pot.

This function blocks the current thread. It creates its own tokio runtime.

Safety pot must be a valid pointer obtained from rgpot_potential_new. The potential and its user_data must remain valid for the lifetime of the server.