Coming from Java I am used to collisions between the name I would like to call an interface and an implementation. In the typical case the solution is to add some additional qualifier to the name of the implementation, but if that's not possible the convention is to suffix 'Impl' onto the end of the implementation name and leave the name of the interface alone.
In contrast in C# the convention is to prefix the interface with "I" and leave the implementation as is.
In Rust it seems that in general this problem comes up less because Traits tend to be more focused then Interfaces in Java or C# but the few times I have seen it the "Impl" suffix seems to be used. This seems reasonable to me.
However I recently encountered a case I had no experience with and was not able to find a convention mentioned online: What if it's not one struct acting as an implementation but several included in an enum?
Specifically I have a trait:
trait Request {
fn get_request_id() -> u64;
//...
}
And several structs that implement this trait:
impl Request for WriteRequest {
//...
}
impl Request for ReadRequest {
//...
}
Then I want to have an enum of the types of request that can be received:
enum RequestXXX {
Write(WriteRequest),
Read(ReadRequest),
//...
}
I am not sure what to call this enum. If it were just a tag IE: "Write, Read" I might call it RequestType or RequestKind. But given that it actually holds the request itself it's not clear to me.
What would you call this enum?