pub struct RpcService<HttpMiddleware> { /* private fields */ }
Expand description
This is the default implementation of the jsonrpsee_core::middleware::RpcServiceT
trait used in the HttpClient
.
An RpcServiceT
compliant implementation for the HTTP client.
Implementations§
Source§impl<HttpMiddleware> RpcService<HttpMiddleware>
impl<HttpMiddleware> RpcService<HttpMiddleware>
Sourcepub fn new(service: HttpTransportClient<HttpMiddleware>) -> Self
pub fn new(service: HttpTransportClient<HttpMiddleware>) -> Self
Convert an HttpTransportClient
into an RpcService
.
Trait Implementations§
Source§impl<HttpMiddleware: Clone> Clone for RpcService<HttpMiddleware>
impl<HttpMiddleware: Clone> Clone for RpcService<HttpMiddleware>
Source§fn clone(&self) -> RpcService<HttpMiddleware>
fn clone(&self) -> RpcService<HttpMiddleware>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<HttpMiddleware: Debug> Debug for RpcService<HttpMiddleware>
impl<HttpMiddleware: Debug> Debug for RpcService<HttpMiddleware>
Source§impl<B, HttpMiddleware> RpcServiceT for RpcService<HttpMiddleware>
impl<B, HttpMiddleware> RpcServiceT for RpcService<HttpMiddleware>
Source§type BatchResponse = Result<Vec<RawResponse<'static>>, Error>
type BatchResponse = Result<Vec<RawResponse<'static>>, Error>
Response type for
RpcServiceT::batch
.Source§type MethodResponse = Result<MiddlewareMethodResponse, Error>
type MethodResponse = Result<MiddlewareMethodResponse, Error>
Response type for
RpcServiceT::call
.Source§type NotificationResponse = Result<MiddlewareNotifResponse, Error>
type NotificationResponse = Result<MiddlewareNotifResponse, Error>
Response type for
RpcServiceT::notification
.Source§fn call<'a>(
&self,
request: Request<'a>,
) -> impl Future<Output = Self::MethodResponse> + Send + 'a
fn call<'a>( &self, request: Request<'a>, ) -> impl Future<Output = Self::MethodResponse> + Send + 'a
Processes a single JSON-RPC call, which may be a subscription or regular call.
Source§fn batch<'a>(
&self,
batch: Batch<'a>,
) -> impl Future<Output = Self::BatchResponse> + Send + 'a
fn batch<'a>( &self, batch: Batch<'a>, ) -> impl Future<Output = Self::BatchResponse> + Send + 'a
Processes multiple JSON-RPC calls at once, similar to
RpcServiceT::call
. Read moreSource§fn notification<'a>(
&self,
notif: Notification<'a>,
) -> impl Future<Output = Self::NotificationResponse> + Send + 'a
fn notification<'a>( &self, notif: Notification<'a>, ) -> impl Future<Output = Self::NotificationResponse> + Send + 'a
Similar to
RpcServiceT::call
but processes a JSON-RPC notification.Auto Trait Implementations§
impl<HttpMiddleware> Freeze for RpcService<HttpMiddleware>
impl<HttpMiddleware> RefUnwindSafe for RpcService<HttpMiddleware>where
HttpMiddleware: RefUnwindSafe,
impl<HttpMiddleware> Send for RpcService<HttpMiddleware>
impl<HttpMiddleware> Sync for RpcService<HttpMiddleware>
impl<HttpMiddleware> Unpin for RpcService<HttpMiddleware>
impl<HttpMiddleware> UnwindSafe for RpcService<HttpMiddleware>where
HttpMiddleware: RefUnwindSafe,
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