/// Constructs a new Response for the server. The `json!()` macro from serde_json should be
/// utilized to construct the result field easily, rather than manually done.
///
/// ## Example
///
/// ```rust
/// #[macro_use] extern crate serde_json;
/// extern crate path_rpc_common;
///
/// use serde_json::Value;
/// use path_rpc_common::Response;
///
/// let res = Response::new(json!("Bad Request"), 0);
///
/// assert_eq!(res.jsonrpc, "2.0");
/// assert_eq!(res.result, Value::String("Bad Request".into()));
/// assert_eq!(res.id, 0);
/// ```
///
Constructs a new Response for the server. The `json!()` macro from serde_json should be
utilized to construct the result field easily, rather than manually done.
Constructs a new Response for the server . The ` json! () ` macro from serde_json should be utilized to construct the result field easily rather than manually done .
pub fn new(result: Value, id: u64) -> Self {
        Self {
            jsonrpc: "2.0".into(),
            result,
            id,
        }
    }
pub fn new ( result : Value , id : u64 ) -> Self { Self { jsonrpc : " " . into ( ) , result , id , } }
Constructs a new Response for the server.
Constructs a new Response for the server .
result
Value
id
u64
example
None
[macro_use] extern crate serde_json;
extern crate path_rpc_common.

use serde_json::Value;
use path_rpc_common::Response.

let res = Response::new(json!("Bad Request"), 0).

assert_eq!(res.jsonrpc, "2.0");
assert_eq!(res.result, Value::String("Bad Request".into()));
assert_eq!(res.id, 0);
```
extern crate path_rpc_common . use serde_json :: Value ; use path_rpc_common :: Response . let res = Response :: new ( json! ( " Bad Request " ) 0 ) . assert_eq! ( res . jsonrpc " 2 . 0 " ) ; assert_eq! ( res . result Value :: String ( " Bad Request " . into () )) ; assert_eq! ( res . id 0 ) ; ` ` `