pub trait JsonRPCClient: Sized {
// Required method
fn call<T>(&self, method: &str, params: &[Value]) -> Result<T, Error>
where T: for<'a> Deserialize<'a> + DeserializeOwned + Debug;
}Expand description
Since the workflow for jsonrpc is the same for all methods, we can implement a trait that will let us call any method on the client, and then implement the methods on any client that implements this trait.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl JsonRPCClient for Client
Available on crate feature
with-jsonrpc only.