Enum jsonrpc_lite::JsonRpc
[−]
[src]
pub enum JsonRpc { Request(Request), Notification(Notification), Success(Success), Error(Error), }
JSON-RPC 2.0 Request object and Response object JSON-RPC 2.0 Specification.
Variants
Request(Request)
Request object
Notification(Notification)
Notification object
Success(Success)
Success Response
Error(Error)
Error Response
Methods
impl JsonRpc
[src]
fn request<I: Into<Id>>(id: I, method: &str) -> Self
Creates a JSON-RPC 2.0 request object without params
fn request_with_params<I: Into<Id>, P: Into<Params>>(
id: I,
method: &str,
params: P
) -> Self
id: I,
method: &str,
params: P
) -> Self
Creates a JSON-RPC 2.0 request object with params
fn notification(method: &str) -> Self
Creates a JSON-RPC 2.0 notification object without params
fn notification_with_params<P: Into<Params>>(method: &str, params: P) -> Self
Creates a JSON-RPC 2.0 notification object with params
fn success<I: Into<Id>>(id: I, result: &Value) -> Self
Creates a JSON-RPC 2.0 success response object
fn error<I: Into<Id>>(id: I, error: RpcError) -> Self
Creates a JSON-RPC 2.0 error response object
fn get_id(&self) -> Option<Id>
fn get_method(&self) -> Option<&str>
fn get_params(&self) -> Option<Params>
fn get_result(&self) -> Option<&Value>
fn get_error(&self) -> Option<&RpcError>
fn parse(input: &str) -> SerdeResult<Self>
fn parse_vec(input: &str) -> SerdeResult<Vec<Self>>
Trait Implementations
impl Clone for JsonRpc
[src]
fn clone(&self) -> JsonRpc
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for JsonRpc
[src]
fn eq(&self, __arg_0: &JsonRpc) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &JsonRpc) -> bool
This method tests for !=
.