Added method to specify host of raw client

This commit is contained in:
Mahesh Bansod 2021-11-07 18:49:15 +05:30
parent 2fcfbe9e67
commit 4003dfe246
1 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,12 @@ pub fn new() -> Client {
} }
} }
pub fn with_host(host: &str) -> Client {
Client {
client: jsonrpc2_client::new(&host),
}
}
impl Client { impl Client {
pub async fn send_request<T: serde::de::DeserializeOwned + std::fmt::Debug>( pub async fn send_request<T: serde::de::DeserializeOwned + std::fmt::Debug>(
&self, &self,