If a thrift definition file contains multiple services, with functions having the same name, the generated code is not valid. There are conflicting definitions of *Args and *Result structs.
Will generate the following code in the same file (I only pasted the interesting bits):
And rustc would complain with errors like:
Another (very similar) issue occurs if a user-defined struct happens to be called (keeping the same example as before) SendResult:
Will generate the following code in the same file (I only pasted the interesting bits)::
Again, conflicting definitions of structs and rustc would complain.
The approach taken by the Go generator (I haven't looked at other languages too much, some other generators probably do the same) for generating internal structs related to a service call is to prepend the service name to each of the structs.
Using the same mechanism would solve both the issues cited above.
I will give it a try and open a PR, but am also definitely open to any feedback on the idea