pub struct JsonrpcRequest {
pub id: RequestId,
pub method: String,
pub params: Option<JsonrpcRequestParams>,
/* private fields */
}
Expand description
A request that expects a response.
JSON schema
{
"description": "A request that expects a response.",
"type": "object",
"required": [
"id",
"jsonrpc",
"method"
],
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"jsonrpc": {
"type": "string",
"const": "2.0"
},
"method": {
"type": "string"
},
"params": {
"type": "object",
"properties": {
"_meta": {
"type": "object",
"properties": {
"progressToken": {
"description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
"$ref": "#/definitions/ProgressToken"
}
}
}
},
"additionalProperties": {}
}
}
}
Fields§
§id: RequestId
§method: String
§params: Option<JsonrpcRequestParams>
Implementations§
Source§impl JsonrpcRequest
impl JsonrpcRequest
pub fn new( id: RequestId, method: String, params: Option<JsonrpcRequestParams>, ) -> JsonrpcRequest
pub fn jsonrpc(&self) -> &String
Trait Implementations§
Source§impl Clone for JsonrpcRequest
impl Clone for JsonrpcRequest
Source§fn clone(&self) -> JsonrpcRequest
fn clone(&self) -> JsonrpcRequest
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for JsonrpcRequest
impl Debug for JsonrpcRequest
Source§impl<'de> Deserialize<'de> for JsonrpcRequest
impl<'de> Deserialize<'de> for JsonrpcRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<JsonrpcRequest> for JsonrpcBatchRequestItem
impl From<JsonrpcRequest> for JsonrpcBatchRequestItem
Source§fn from(value: JsonrpcRequest) -> JsonrpcBatchRequestItem
fn from(value: JsonrpcRequest) -> JsonrpcBatchRequestItem
Converts to this type from the input type.
Source§impl From<JsonrpcRequest> for JsonrpcMessage
impl From<JsonrpcRequest> for JsonrpcMessage
Source§fn from(value: JsonrpcRequest) -> JsonrpcMessage
fn from(value: JsonrpcRequest) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl Serialize for JsonrpcRequest
impl Serialize for JsonrpcRequest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for JsonrpcRequest
impl RefUnwindSafe for JsonrpcRequest
impl Send for JsonrpcRequest
impl Sync for JsonrpcRequest
impl Unpin for JsonrpcRequest
impl UnwindSafe for JsonrpcRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more