Skip to main content

ServiceDispatch

Trait ServiceDispatch 

Source
pub trait ServiceDispatch:
    Send
    + Sync
    + 'static {
    // Required method
    fn dispatch(
        &self,
        ctx: &RpcContext,
        method_id: u16,
        args: &[u8],
        codec: &Codec,
    ) -> Result<Vec<u8>, RpcError>;
}
Expand description

Trait for dispatching RPC calls to handler methods.

This is auto-implemented by the #[mill_rpc::service] macro for any type that implements the generated {Service}Server trait.

Required Methods§

Source

fn dispatch( &self, ctx: &RpcContext, method_id: u16, args: &[u8], codec: &Codec, ) -> Result<Vec<u8>, RpcError>

Implementors§