Expand description
JSON-RPC primitives JSON-RPC 2.0 object definitions
Structs§
- Json
Error - A JSON-RPC error object
- Json
Error Val - A JSON-RPC error value (code and message)
- Json
Notification - A JSON-RPC notification object
- Json
Request - A JSON-RPC request object
- Json
Response - A JSON-RPC response object
- Json
Subscriber - A JSON-RPC subscriber for notifications
Enums§
- Error
Code - JSON-RPC error codes.
The error codes
[-32768, -32000]are reserved for predefined errors. - Json
Result - Wrapping enum around the available JSON-RPC object types
Functions§
- parse_
json_ array_ number - Parses the element at the specified index in a
JsonValue::Arrayinto anf64(compatible withJsonValue::Number). Returns the number if successful, or an error if the parameter is missing, not an array, or is not a valid number. - parse_
json_ array_ string - Parses the element at the specified index in a
JsonValue::Arrayinto a string. Returns the string if successful, or an error if the parameter is missing, not an array, or not a valid string. - parse_
json_ number - Parses a
JsonValueparameter into af64. Returns the number if successful or an error if the value is not a valid number. - parse_
json_ response_ string - Attempts to parse a
JsonResult, converting it into aJsonResponseand extracting a string result from it. Returns an error if conversion or extraction fails, and the extracted string on success. - parse_
json_ string - Parses a
JsonValueparameter into aString. Returns the string if successful or an error if the value is not a valid string. - to_
json_ array - Converts the provided JSON-RPC parameters into an array of JSON values, returning a reference to the array if successful, or a JsonResult error containing a JsonError when the input is not a JSON array.
- validate_
empty_ params - Validates whether the provided JSON parameter is an empty array or object, returning success if it is empty or an Error if it contains values.