Definition at line 178 of file rpc.h.
|
| | Rpc () FL_NOEXCEPT=default |
| |
| | Rpc (const Rpc &) FL_NOEXCEPT=delete |
| |
| | Rpc (Rpc &&) FL_NOEXCEPT=default |
| |
| | ~Rpc () FL_NOEXCEPT=default |
| |
| template<typename Callable> |
| void | bind (const char *name, Callable fn, fl::RpcMode mode=fl::RpcMode::SYNC) |
| | Convenience overload: bind method by name, function, and optional mode.
|
| |
| template<typename Callable> |
| void | bind (const Config< Callable > &config) |
| | 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) |
| | 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 | clear () |
| | Clear all registered methods.
|
| |
| fl::size | count () const |
| | Returns number of registered methods.
|
| |
| template<class Sig> |
| BindResult< Sig > | get (const char *name) const |
| | Get a registered method by name.
|
| |
| json | handle (const json &request) |
| | Process a JSON-RPC request.
|
| |
| fl::optional< json > | handle_maybe (const json &request) |
| | For notifications (no id), returns nullopt.
|
| |
| bool | has (const char *name) const |
| | Check if a method is registered (regardless of signature).
|
| |
| json | methods () const |
| | Returns flat method array: [["name", "returnType", [["param1", "type1"], ...]], ...] Format: Array of method tuples optimized for low-memory devices.
|
| |
| Rpc & | operator= (const Rpc &) FL_NOEXCEPT=delete |
| |
| Rpc & | operator= (Rpc &&) FL_NOEXCEPT=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) |
| |
| json | schema () const |
| | Returns flat schema document.
|
| |
| void | setResponseSink (fl::function< void(const fl::json &)> sink) |
| | Set response sink for sending ACK responses (used by async functions)
|
| |
| fl::vector< fl::string > | tags () const |
| | Returns list of unique tags used across all methods.
|
| |
| bool | unbind (const char *name) |
| | Unbind (unregister) a previously registered method.
|
| |