/// This wrapper helper adds a tracing span around all rpc methods with name = method_name.
///
/// It could do more, for example trace the outputs, durations.
///
/// This is the only one method provided at the moment, because it's the only one used. If you
/// need to use some other `register_*` method from [`jsonrpsee::RpcModule`], just add it to
/// this wrapper.
This wrapper helper adds a tracing span around all rpc methods with name = method_name.
It could do more, for example trace the outputs, durations.

This is the only one method provided at the moment, because it's the only one used. If you
need to use some other `register_*` method from [`jsonrpsee::RpcModule`], just add it to
this wrapper.
This wrapper helper adds a tracing span around all rpc methods with name = method_name . It could do more for example trace the outputs durations . This is the only one method provided at the moment because it ' s the only one used . If you need to use some other ` register_ * ` method from [ ` jsonrpsee :: RpcModule ` ] just add it to this wrapper .
fn register_async_method<R, Fun, Fut>(
        &mut self,
        method_name: &'static str,
        callback: Fun,
    ) -> Result<jsonrpsee::utils::server::rpc_module::MethodResourcesBuilder, jsonrpsee::types::Error>
    where
        R: ::serde::Serialize + Send + Sync + 'static,
        Fut: std::future::Future<Output = Result<R, Error>> + Send,
        Fun: (Fn(jsonrpsee::types::v2::Params<'static>, std::sync::Arc<Context>) -> Fut)
            + Copy
            + Send
            + Sync
            + 'static,
    {
        use tracing::Instrument;
        self.0.register_async_method(method_name, move |p, c| {
            // why info here? it's the same used in warp tracing filter for example.
            let span = tracing::info_span!("rpc_method", name = method_name);
            callback(p, c).instrument(span)
        })
    }
fn register_async_method < R , Fun , Fut > ( & mut self , method_name : & ' static str , callback : Fun , ) -> Result < jsonrpsee :: utils :: server :: rpc_module :: MethodResourcesBuilder , jsonrpsee :: types :: Error > where R : :: serde :: Serialize + Send + Sync + ' static , Fut : std :: future :: Future < Output = Result < R , Error > > + Send , Fun : ( Fn ( jsonrpsee :: types :: v2 :: Params < ' static > , std :: sync :: Arc < Context > ) -> Fut ) + Copy + Send + Sync + ' static , { use tracing :: Instrument ; self . 0 . register_async_method ( method_name , move | p , c | { // why info here? it's the same used in warp tracing filter for example. let span = tracing :: info_span ! ( " " name method_name ) ; callback ( p , c ) . instrument ( span ) } ) }
This wrapper helper adds a tracing span around all rpc methods with name = method_name.
This wrapper helper adds a tracing span around all rpc methods with name = method_name .
&mut self
method_name
&'static str
callback
Fun