I am new to Rust language, discovering the language last week, while trying to solve an issue with a PHP project I am working on.
I have been spending time reading "The Book", and blogs, particular the error handling done in Rust, rather different paradigm in the way of thinking, interesting none the less, just need time to get use to it.
I decided to look at packages structuring, and the like before starting to develop Rust packages (libraries and binaries), to ensure I don't make a fine mess of things. Considering I notice people mentioning that once packages are published to crates.io, you can't change package and crate names at all. Any added to crates.io is permanent, so care is required when publishing. Thus I decided to look up what is the naming convention used for packages, and crates (particular libraries), and the namespace the various Rust objects will live in.
I do see there is plenty discussion regarding the naming convention of structs, methods, functions, modules (interesting concept within a Rust file), yet hardly any concrete convention for crates and packages. Coming from a PHP environment, we have Packagist, which has a convention for naming the package and the starting namespace for the classes, and other bits, in that the package name starts with vendor (name/abbreviation), separator, followed by library/binary name (or abbreviation). The name space typically mirrors the package name, starting with vendor, , library name, and the class/interface/trait hierarchy following the second .
I would like to follow this naming scheme in rust to avoid naming clashes of crates, packages, and the structs/modules. The namespace would be "vendor::crate::...", which would match the crate and package name.
Yet, I am struggling to find the convention for naming packages and crates, I have come across confusing discussions about the use of hyphens "-" and underscores "_". Yet nothing official regarding this along with naming convention of packages and crates.
I appreciate any advice regarding the naming convention of packages, crates, and namespace.