pub struct RpcClientBuilder { /* private fields */ }Expand description
Configures an RpcClient.
Implementations§
Source§impl RpcClientBuilder
impl RpcClientBuilder
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Timeout for each request, including retries individually.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Adds a header to every request, e.g. an API key for a hosted node.
Sourcepub fn retries(self, retries: u32, backoff: Duration) -> Self
pub fn retries(self, retries: u32, backoff: Duration) -> Self
Retries after connection failures and HTTP 429/502/503/504, with
exponential backoff starting at backoff. JSON-RPC errors are never
retried.
pub fn build(self) -> RpcClient
Trait Implementations§
Source§impl Clone for RpcClientBuilder
impl Clone for RpcClientBuilder
Auto Trait Implementations§
impl Freeze for RpcClientBuilder
impl RefUnwindSafe for RpcClientBuilder
impl Send for RpcClientBuilder
impl Sync for RpcClientBuilder
impl Unpin for RpcClientBuilder
impl UnsafeUnpin for RpcClientBuilder
impl UnwindSafe for RpcClientBuilder
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