pub fn add_cast_handler_with_decoder<T, H, D>(
        &mut self,
        handler: H,
        decoder_factory: D,
    ) -> &mut Self
    where
        T: Cast,
        H: HandleCast<T>,
        D: Factory<Item = T::Decoder> + Send + Sync + 'static,
    {
        assert!(
            !self.handlers.0.contains_key(&T::ID),
            "RPC registration conflicts: procedure={:?}, name={:?}",
            T::ID,
            T::NAME
        );

        let metrics = HandlerMetrics::new(self.metrics.clone(), T::ID, T::NAME, "cast");
        self.handlers_metrics.insert(T::ID, metrics.clone());

        let handler = CastHandlerFactory::new(handler, decoder_factory, metrics);
        self.handlers.0.insert(T::ID, Box::new(handler));
        self
    }
/// Registers a handler (with the given decoder maker) for the notification RPC.
///
/// # Panices
///
/// If a procedure which has `T::ID` already have been registered, the calling thread will panic.
Registers a handler (with the given decoder maker) for the notification RPC.
Registers a handler ( with the given decoder maker ) for the notification RPC .
pub fn add_cast_handler_with_decoder<T, H, D>(
        &mut self,
        handler: H,
        decoder_factory: D,
    ) -> &mut Self
    where
        T: Cast,
        H: HandleCast<T>,
        D: Factory<Item = T::Decoder> + Send + Sync + 'static,
    {
        assert!(
            !self.handlers.0.contains_key(&T::ID),
            "RPC registration conflicts: procedure={:?}, name={:?}",
            T::ID,
            T::NAME
        );
        let metrics = HandlerMetrics::new(self.metrics.clone(), T::ID, T::NAME, "cast");
        self.handlers_metrics.insert(T::ID, metrics.clone());
        let handler = CastHandlerFactory::new(handler, decoder_factory, metrics);
        self.handlers.0.insert(T::ID, Box::new(handler));
        self
    }
pub fn add_cast_handler_with_decoder < T , H , D > ( & mut self , handler : H , decoder_factory : D , ) -> & mut Self where T : Cast , H : HandleCast < T > , D : Factory < Item = T :: Decoder > + Send + Sync + ' static , { assert ! ( self handlers 0 contains_key ( T ID ) " " T ID T NAME ) ; let metrics = HandlerMetrics :: new ( self . metrics . clone ( ) , T :: ID , T :: NAME , " " ) ; self . handlers_metrics . insert ( T :: ID , metrics . clone ( ) ) ; let handler = CastHandlerFactory :: new ( handler , decoder_factory , metrics ) ; self . handlers . 0 . insert ( T :: ID , Box :: new ( handler ) ) ; self }
Registers a handler (with the given decoder maker) for the notification RPC.
Registers a handler ( with the given decoder maker ) for the notification RPC .
&mut self
handler
H
decoder_factory
D
&mut self
handler
H
decoder_factory
D
panices
If a procedure which has `T::ID` already have been registered, the calling thread will panic.
If a procedure which has ` T :: ID ` already have been registered the calling thread will panic .