struct JsonRpc::Request
- JsonRpc::Request
- Struct
- Value
- Object
Overview
Encapsulates a JSON-RPC request object
Included Modules
- JSON::Serializable
- JsonRpc::MessageHeader
Defined in:
json_rpc/request.crConstructors
Instance Method Summary
-
#error(code : Int32, message : String, data : JSON::Any | Nil = nil)
Creates an error response.
- #method : String
- #params : JSON::Any | Nil
- #raw_params : String | Nil
-
#respond(failure : LocalCallError)
Creates an error response.
-
#respond(result)
Creates a successful response based on result.
-
#respond_later(client : Client) : DelayedResponse
Returns a
DelayedResponse
, bound to client.
Instance methods inherited from module JsonRpc::MessageHeader
id : IdType | Nil
id,
jsonrpc : String | Nil
jsonrpc
Constructor Detail
Instance Method Detail
def error(code : Int32, message : String, data : JSON::Any | Nil = nil)
#
Creates an error response.
Returns a DelayedResponse
, bound to client.
Return the result of this method from your Handler#handle_rpc_call
, and
keep a handle to it somewhere to respond later.