Cargo: A standard schema for crate feature flags documentation?

⚓ Rust    📅 2025-08-11    👤 surdeus    👁️ 5      

surdeus

I have an idea about Cargo features documentation. A toml schema that crate authors-maintainers can add to Cargo.toml, or it's own file like features.toml that explains to the user of the crate what exactly to expect when adding that feature flag. So IDE autocompletion and documentation tools can scan the file and produce useful info about the feature while editing the application's own Cargo.toml file, or searching for the crate with cargo search.

Something in the lines of:

  • This feature adds this exact functionality to your application
  • This feature modifies code in this way. Disabling this and enabling that.
  • This feature will increase the binary size approximately this much
  • This feature has these gotchas so be careful
  • This feature is standalone and you pay only if you use it or parts of it
  • This feature depends on this and that
  • This feature is unstable-experimental, use it for testing only

These are the things that came to my mind in a quick brainstorm. They're in no way the final draft proposal :slight_smile:

And maybe something like this is already in the works? But if not:

How can I pass this proposal or whatever it is to Rust people? Is there an spmc channel to the higher up?

3 posts - 3 participants

Read full topic

🏷️ Rust_feed