Definition at line 181 of file rpc.h.
|
| | Rpc () FL_NO_EXCEPT=default |
| |
| | Rpc (const Rpc &) FL_NO_EXCEPT=delete |
| |
| | Rpc (Rpc &&) FL_NO_EXCEPT=default |
| |
| | ~Rpc () FL_NO_EXCEPT=default |
| |
| template<typename Callable> |
| void | bind (const char *name, Callable fn, fl::RpcMode mode=fl::RpcMode::SYNC) FL_NO_EXCEPT |
| | Convenience overload: bind method by name, function, and optional mode.
|
| |
| template<typename Callable> |
| void | bind (const Config< Callable > &config) FL_NO_EXCEPT |
| | Bind a method with configuration (name, function, optional metadata).
|
| |
| void | bindAsync (const char *name, fl::function< void(ResponseSend &, const json &)> fn, fl::RpcMode mode=fl::RpcMode::ASYNC) FL_NO_EXCEPT |
| | Bind async method with ResponseSend& parameter (for ASYNC/ASYNC_STREAM modes) Signature: void(ResponseSend&, const json&) The ResponseSend& parameter is automatically injected with request ID and response sink The json& parameter contains the raw JSON params from the request.
|
| |
| void | bindStreaming (const char *name, fl::StreamingRpcHandler fn) FL_NO_EXCEPT |
| | Bind a method that streams its JSON-RPC result directly to the transport.
|
| |
| void | clear () FL_NO_EXCEPT |
| | Clear all registered methods.
|
| |
| fl::size | count () const FL_NO_EXCEPT |
| | Returns number of registered methods.
|
| |
| template<class Sig> |
| BindResult< Sig > | get (const char *name) const FL_NO_EXCEPT |
| | Get a registered method by name.
|
| |
| json | handle (const json &request) FL_NO_EXCEPT |
| | Process a JSON-RPC request.
|
| |
| fl::optional< json > | handle_maybe (const json &request) FL_NO_EXCEPT |
| | For notifications (no id), returns nullopt.
|
| |
| bool | has (const char *name) const FL_NO_EXCEPT |
| | Check if a method is registered (regardless of signature).
|
| |
| json | methods () const FL_NO_EXCEPT |
| | Returns flat method array: [["name", "returnType", [["param1", "type1"], ...]], ...] Format: Array of method tuples optimized for low-memory devices.
|
| |
| Rpc & | operator= (const Rpc &) FL_NO_EXCEPT=delete |
| |
| Rpc & | operator= (Rpc &&) FL_NO_EXCEPT=default |
| |
| template<class Sig> |
| bool | registerMethod (const char *name, RpcFn< Sig > fn, const fl::vector< fl::string > ¶mNames, const fl::string &description, const fl::vector< fl::string > &tags, fl::RpcMode mode=fl::RpcMode::SYNC) FL_NO_EXCEPT |
| |
| json | schema () const FL_NO_EXCEPT |
| | Returns flat schema document.
|
| |
| void | setResponseSink (fl::function< void(const fl::json &)> sink) FL_NO_EXCEPT |
| | Set response sink for sending ACK responses (used by async functions)
|
| |
| void | setResponseStreamSink (fl::ResponseStreamSink sink) FL_NO_EXCEPT |
| | Set response stream sink for methods registered with bindStreaming().
|
| |
| fl::vector< fl::string > | tags () const FL_NO_EXCEPT |
| | Returns list of unique tags used across all methods.
|
| |
| bool | unbind (const char *name) FL_NO_EXCEPT |
| | Unbind (unregister) a previously registered method.
|
| |