pub struct RpcLogger<S> { /* private fields */ }
Expand description
A middleware that logs each RPC call and response.
Trait Implementations§
Source§impl<S> RpcServiceT for RpcLogger<S>where
S: RpcServiceT + Send + Sync + Clone + 'static,
S::MethodResponse: ToJson,
S::BatchResponse: ToJson,
impl<S> RpcServiceT for RpcLogger<S>where
S: RpcServiceT + Send + Sync + Clone + 'static,
S::MethodResponse: ToJson,
S::BatchResponse: ToJson,
Source§type MethodResponse = <S as RpcServiceT>::MethodResponse
type MethodResponse = <S as RpcServiceT>::MethodResponse
Response type for
RpcServiceT::call
.Source§type NotificationResponse = <S as RpcServiceT>::NotificationResponse
type NotificationResponse = <S as RpcServiceT>::NotificationResponse
Response type for
RpcServiceT::notification
.Source§type BatchResponse = <S as RpcServiceT>::BatchResponse
type BatchResponse = <S as RpcServiceT>::BatchResponse
Response type for
RpcServiceT::batch
.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,
n: Notification<'a>,
) -> impl Future<Output = Self::NotificationResponse> + Send + 'a
fn notification<'a>( &self, n: Notification<'a>, ) -> impl Future<Output = Self::NotificationResponse> + Send + 'a
Similar to
RpcServiceT::call
but processes a JSON-RPC notification.Auto Trait Implementations§
impl<S> Freeze for RpcLogger<S>where
S: Freeze,
impl<S> RefUnwindSafe for RpcLogger<S>where
S: RefUnwindSafe,
impl<S> Send for RpcLogger<S>where
S: Send,
impl<S> Sync for RpcLogger<S>where
S: Sync,
impl<S> Unpin for RpcLogger<S>where
S: Unpin,
impl<S> UnwindSafe for RpcLogger<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