pub struct RpcClient { /* private fields */ }Expand description
A Sui JSON-RPC 2.0 client over reqwest.
Implementations§
Source§impl RpcClient
impl RpcClient
Sourcepub fn new(endpoint: impl Into<String>) -> Self
pub fn new(endpoint: impl Into<String>) -> Self
Construct a client pointing at the given JSON-RPC endpoint URL.
Applies a 30-second per-request timeout. Use RpcClient::with_timeout
if you need a different cap.
Sourcepub fn with_timeout(endpoint: impl Into<String>, timeout: Duration) -> Self
pub fn with_timeout(endpoint: impl Into<String>, timeout: Duration) -> Self
Construct with an explicit per-request timeout.
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 UnsafeUnpin 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