Struct sota::datatype::json_rpc::RpcErr
[−]
[src]
pub struct RpcErr { pub jsonrpc: String, pub id: u64, pub error: ErrorCode, }
Encapsulates a failed JSON-RPC response.
Fields
jsonrpc | |
id | |
error |
Methods
impl RpcErr
[src]
fn new(id: u64, error: ErrorCode) -> Self
Instantiate a new RpcErr
type with the default JSON-RPC version (2.0).
fn invalid_request(id: u64, data: String) -> Self
Create a new RpcErr
with a reason of "Invalid Request".
fn method_not_found(id: u64, data: String) -> Self
Create a new RpcErr
with a reason of "Method not found".
fn parse_error(data: String) -> Self
Create a new RpcErr
with a reason of "Parse error".
fn invalid_params(id: u64, data: String) -> Self
Create a new RpcErr
with a reason of "Invalid params".
fn unspecified(id: u64, data: String) -> Self
Create a new RpcErr
with a reason of "Couldn't handle request".
Trait Implementations
Derived Implementations
impl Encodable for RpcErr
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
Serialize a value using an Encoder
.