| 98 | /// Response is expressed as a single JSON Object, with the following members: |
| 99 | #[derive(Debug, Serialize, Deserialize)] |
| 100 | pub struct Response { |
| 101 | /// A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0". |
| 102 | pub jsonrpc: String, |
| 103 | |
| 104 | /// This member is REQUIRED on success. |
| 105 | /// This member MUST NOT exist if there was an error invoking the method. |
| 106 | /// The value of this member is determined by the method invoked on the Server. |
| 107 | pub result: Value, |
| 108 | |
| 109 | // This member is REQUIRED on error. |
| 110 | // This member MUST NOT exist if there was no error triggered during invocation. |
| 111 | // The value for this member MUST be an Object as defined in section 5.1. |
| 112 | #[serde(skip_serializing_if = "Option::is_none")] |
| 113 | pub error: Option<ErrorData>, |
| 114 | |
| 115 | /// This member is REQUIRED. |
| 116 | /// It MUST be the same as the value of the id member in the Request Object. |
| 117 | /// If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), |
| 118 | /// it MUST be Null. |
| 119 | pub id: Value, |
| 120 | } |
| 121 | |
| 122 | impl Response { |
| 123 | /// Prints out the value as JSON string. |
no outgoing calls
no test coverage detected