pub struct RpcClient { /* private fields */ }
Expand description
Thin wrapper around a transport for making RPC calls
Implementations§
Source§impl RpcClient
impl RpcClient
Sourcepub fn from_transport(inner: Arc<dyn TransportTrait>) -> Self
pub fn from_transport(inner: Arc<dyn TransportTrait>) -> Self
Wrap an existing transport (no URL+auth dance)
Sourcepub fn new(url: &str, user: &str, pass: &str) -> Self
pub fn new(url: &str, user: &str, pass: &str) -> Self
Create a new RPC client with URL and auth
Sourcepub async fn call_method(
&self,
method: &str,
params: &[Value],
) -> Result<Value, TransportError>
pub async fn call_method( &self, method: &str, params: &[Value], ) -> Result<Value, TransportError>
Call a JSON-RPC method
Sourcepub fn batch(&self) -> BatchBuilder
pub fn batch(&self) -> BatchBuilder
Start building a batch of RPC calls
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RpcClient
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more