The Marshaler interface is used to transform internal types to decorated RPC ones. It decouples that functionality form the rpcServer so it is easier to test exhaustively.