Currently the NamedService trait assumes that codegen from Prost is used to generate at compile time a const field that has a service name. This trait must be implemented on a service in order for the router to accept it (add_service in router.rs requires the NamedService trait).
This prevents the creation of services with names not known at compile time.
Motivation
I am creating an IDL agnostic server, using FFI to bridge to C++ which will handle the payload as the server is unable to serialize or deserialize it. In this scheme, the C++ client code will register methods onto a service with callbacks. Since the server will not know at compile time what the services it will be running are called, I currently must use a single placeholder service name.
Feature Request
Currently the
NamedService
trait assumes that codegen from Prost is used to generate at compile time a const field that has a service name. This trait must be implemented on a service in order for the router to accept it (add_service
inrouter.rs
requires theNamedService
trait).This prevents the creation of services with names not known at compile time.
Motivation
I am creating an IDL agnostic server, using FFI to bridge to C++ which will handle the payload as the server is unable to serialize or deserialize it. In this scheme, the C++ client code will register methods onto a service with callbacks. Since the server will not know at compile time what the services it will be running are called, I currently must use a single placeholder service name.
Proposal
Needs to shift to something more like:
And the subsequent internal modifications to both Tonic and Prost to support this need implemented.
I am new to Rust and not confident enough to implement this publicly. Suggestions and feedback welcomed.