pub struct HttpJsonRpcClient { /* private fields */ }Expand description
A builder to create a http jsonrpc client.
Implementations§
Source§impl HttpJsonRpcClient
impl HttpJsonRpcClient
Sourcepub fn header<K, V>(self, key: K, value: V) -> Selfwhere
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<HttpError>,
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<HttpError>,
Appends a http header to the http JsonRpcClient builder.
Sourcepub fn extension<T>(self, extension: T) -> Self
pub fn extension<T>(self, extension: T) -> Self
Add an extension to the http JsonRpcClient builder.
Sourcepub fn redirect<R: ToSocketAddrs>(self, raddrs: R) -> Self
pub fn redirect<R: ToSocketAddrs>(self, raddrs: R) -> Self
Rewrite http request’s host:port fields and send request to the specified raddrs.
Sourcepub fn with_server_name(self, server_name: &str) -> Self
pub fn with_server_name(self, server_name: &str) -> Self
Set remote server’s server name, this option will rewrite request’s host field.
Sourcepub fn with_ca_file<P: AsRef<Path>>(self, ca_file: P) -> Self
pub fn with_ca_file<P: AsRef<Path>>(self, ca_file: P) -> Self
Set the server verification ca file, this is useful for self signed server.
Sourcepub fn timeout(self, duration: Duration) -> Self
pub fn timeout(self, duration: Duration) -> Self
Set the timeout duration of the jsonrpc call via http request.
Sourcepub fn set_use_server_name_indication(self, value: bool) -> Self
pub fn set_use_server_name_indication(self, value: bool) -> Self
Configures the use of Server Name Indication (SNI) when connecting. Defaults to true.
Sourcepub fn create(self) -> Result<JsonRpcClient>
pub fn create(self) -> Result<JsonRpcClient>
Consume builder and create a new JsonRpcClient instance.