pub fn new(method: &str, params: Value, id: u64) -> Self {
        Self {
            jsonrpc: "2.0".into(),
            method: method.into(),
            params,
            id,
        }
    }
/// Constructs a new Request for the server. The `json!()` macro from serde_json should be
/// utilized to construct the params 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::Request;
///
/// let req = Request::new("new_path", json!({ "test": "testing" }), 0);
/// let mut map = serde_json::map::Map::new();
/// map.insert("test".into(), Value::String("testing".into()));
/// let val = Value::Object(map);
///
/// assert_eq!(req.jsonrpc, "2.0");
/// assert_eq!(req.method, "new_path");
/// assert_eq!(req.params, val);
/// assert_eq!(req.id, 0);
/// ```
///
Constructs a new Request for the server. The `json!()` macro from serde_json should be
utilized to construct the params field easily, rather than manually done.
Constructs a new Request for the server . The ` json! () ` macro from serde_json should be utilized to construct the params field easily rather than manually done .
pub fn new(method: &str, params: Value, id: u64) -> Self {
        Self {
            jsonrpc: "2.0".into(),
            method: method.into(),
            params,
            id,
        }
    }
pub fn new ( method : & str , params : Value , id : u64 ) -> Self { Self { jsonrpc : " " . into ( ) , method : method . into ( ) , params , id , } }
Constructs a new Request for the server.
Constructs a new Request for the server .
method
&str
params
Value
id
u64
method
&str
params
Value
id
u64
example
None
[macro_use] extern crate serde_json;
extern crate path_rpc_common.

use serde_json::Value;
use path_rpc_common::Request.

let req = Request::new("new_path", json!({ "test": "testing" }), 0);
let mut map = serde_json::map::Map::new();
map.insert("test".into(), Value::String("testing".into()));
let val = Value::Object(map).


extern crate path_rpc_common . use serde_json :: Value ; use path_rpc_common :: Request . let req = Request :: new ( " new_path " json! ( { " test " : " testing " } ) 0 ) ; let mut map = serde_json :: map :: Map :: new () ; map . insert ( " test " . into () Value :: String ( " testing " . into () )) ; let val = Value :: Object ( map ) .