I have two crates: httpbis and grpc, implementations of HTTP/2 and gRPC correspondingly.
These crates have a lot of similar types: error, result, client, server, configuration etc.
One of the hardest problem things in computer science is naming things.
The question is, how these types should be named? With prefix or without? Should types be called
httpbis::Error, httpbis::Result, httpbis::Client, https::Server grpc::Error, grpc::Result, grpc::Client, grpc::Server
Http2Error, Http2Result, Http2Client, Http2Server GrpcError, GrpcResult, GrpcClient, GrpcServer
Is there style guide or best practices or something like that?
I came from Java, so currently types have long names (e. g.
GrpcResult). But as I see, most of the libraries use short names (e. g. hyper, clap or native-tls). So make libraries similar to common rust conventions, I think I need to rename.
And another similar question. So I have
Server. Should they be reexported as
httpbis::Server or be accessible as
httpbis::server::Server? Or should they be accessible by both names as in hyper (
hyper::client::Client)? API exposes tons of other types, e. g.
HttpResponse, should all these types be reexported in library root namespace, or live in submodules?