pub struct HttpClient<S = RpcLogger<RpcService<HttpBackend>>> { /* private fields */ }
Expand description
JSON-RPC HTTP Client that provides functionality to perform method calls and notifications.
Implementations§
Source§impl HttpClient<HttpBackend>
impl HttpClient<HttpBackend>
Sourcepub fn builder() -> HttpClientBuilder
pub fn builder() -> HttpClientBuilder
Create a builder for the HttpClient.
Sourcepub fn request_timeout(&self) -> Duration
pub fn request_timeout(&self) -> Duration
Returns configured request timeout.
Trait Implementations§
Source§impl<S> ClientT for HttpClient<S>where
S: RpcServiceT<MethodResponse = Result<MiddlewareMethodResponse, Error>, BatchResponse = Result<MiddlewareBatchResponse, Error>, NotificationResponse = Result<MiddlewareNotifResponse, Error>> + Send + Sync,
impl<S> ClientT for HttpClient<S>where
S: RpcServiceT<MethodResponse = Result<MiddlewareMethodResponse, Error>, BatchResponse = Result<MiddlewareBatchResponse, Error>, NotificationResponse = Result<MiddlewareNotifResponse, Error>> + Send + Sync,
Source§fn notification<Params>(
&self,
method: &str,
params: Params,
) -> impl Future<Output = Result<(), Error>> + Sendwhere
Params: ToRpcParams + Send,
fn notification<Params>(
&self,
method: &str,
params: Params,
) -> impl Future<Output = Result<(), Error>> + Sendwhere
Params: ToRpcParams + Send,
Send a notification request
Source§fn request<R, Params>(
&self,
method: &str,
params: Params,
) -> impl Future<Output = Result<R, Error>> + Send
fn request<R, Params>( &self, method: &str, params: Params, ) -> impl Future<Output = Result<R, Error>> + Send
Send a method call request.
Source§fn batch_request<'a, R>(
&self,
batch: BatchRequestBuilder<'a>,
) -> impl Future<Output = Result<BatchResponse<'a, R>, Error>> + Sendwhere
R: DeserializeOwned + Debug + 'a,
fn batch_request<'a, R>(
&self,
batch: BatchRequestBuilder<'a>,
) -> impl Future<Output = Result<BatchResponse<'a, R>, Error>> + Sendwhere
R: DeserializeOwned + Debug + 'a,
Send a batch request. Read more
Source§impl<S: Clone> Clone for HttpClient<S>
impl<S: Clone> Clone for HttpClient<S>
Source§fn clone(&self) -> HttpClient<S>
fn clone(&self) -> HttpClient<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<S: Debug> Debug for HttpClient<S>
impl<S: Debug> Debug for HttpClient<S>
Source§impl<S> SubscriptionClientT for HttpClient<S>where
S: RpcServiceT<MethodResponse = Result<MiddlewareMethodResponse, Error>, BatchResponse = Result<MiddlewareBatchResponse, Error>, NotificationResponse = Result<MiddlewareNotifResponse, Error>> + Send + Sync,
impl<S> SubscriptionClientT for HttpClient<S>where
S: RpcServiceT<MethodResponse = Result<MiddlewareMethodResponse, Error>, BatchResponse = Result<MiddlewareBatchResponse, Error>, NotificationResponse = Result<MiddlewareNotifResponse, Error>> + Send + Sync,
Source§fn subscribe<'a, N, Params>(
&self,
_subscribe_method: &'a str,
_params: Params,
_unsubscribe_method: &'a str,
) -> impl Future<Output = Result<Subscription<N>, Error>>
fn subscribe<'a, N, Params>( &self, _subscribe_method: &'a str, _params: Params, _unsubscribe_method: &'a str, ) -> impl Future<Output = Result<Subscription<N>, Error>>
Send a subscription request to the server. Not implemented for HTTP; will always return
Error::HttpNotImplemented
.
Source§fn subscribe_to_method<N>(
&self,
_method: &str,
) -> impl Future<Output = Result<Subscription<N>, Error>>where
N: DeserializeOwned,
fn subscribe_to_method<N>(
&self,
_method: &str,
) -> impl Future<Output = Result<Subscription<N>, Error>>where
N: DeserializeOwned,
Subscribe to a specific method. Not implemented for HTTP; will always return Error::HttpNotImplemented
.
Auto Trait Implementations§
impl<S> Freeze for HttpClient<S>where
S: Freeze,
impl<S> RefUnwindSafe for HttpClient<S>where
S: RefUnwindSafe,
impl<S> Send for HttpClient<S>where
S: Send,
impl<S> Sync for HttpClient<S>where
S: Sync,
impl<S> Unpin for HttpClient<S>where
S: Unpin,
impl<S> UnwindSafe for HttpClient<S>where
S: UnwindSafe,
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