mod server¶
- module server¶
Cap’n Proto RPC server that dispatches incoming
calculatecalls to argpot_potential_tcallback.DLPack Integration
Incoming data is deserialized from Cap’n Proto into owned
Vecvalues, 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 topot.This function blocks the current thread. It creates its own tokio runtime.
Safety
potmust be a valid pointer obtained fromrgpot_potential_new. The potential and its user_data must remain valid for the lifetime of the server.