File structure
Assign code to the narrowest capability that owns it.
Crates and modules
Why
Domain logic should not need a binary's terminal presentation to inspect a value.
Rules
MUST separate reusable library behavior from binary presentation and resource adapters.[review]
MUST use Cargo workspaces when the repository owns multiple related crates.[review]
MUST keeplib.rsandmain.rsentrypoints small and deliberate.[review]
MUST expose only the supported public surface; prefer private orpub(crate)items internally.[review]
MUST name modules for domain responsibilities rather than catch-all helpers.[review]
MUST use explicit imports and re-exports rather than wildcard API surfaces.[review]
MUST keep tests beside their capability or in the owning crate's integration tests.[review]
[review]
Cargo and the compiler validate module boundaries. Review checks ownership, public visibility, and entrypoint scope.
Enforcement
Cargo and the compiler validate module boundaries. Review checks ownership, public visibility, and entrypoint scope.