MCPcopy Create free account
hub / github.com/actix/examples / Response

Class Response

json/jsonrpc/src/convention.rs:100–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98/// Response is expressed as a single JSON Object, with the following members:
99#[derive(Debug, Serialize, Deserialize)]
100pub 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
122impl Response {
123 /// Prints out the value as JSON string.

Callers 8

bad_requestFunction · 0.85
not_foundFunction · 0.85
internal_server_errorFunction · 0.85
not_foundFunction · 0.85
not_foundFunction · 0.85
not_foundFunction · 0.85
not_foundFunction · 0.85
not_foundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected