Workspace Member List


How can I list the workspace.member members in the Cargo.toml file? Do I need to read from within the toml file or is there a command like CARGO_PKG_VERSION? I've read the documentation but couldn't find it.


In what context do you want to do this? A package's build should not depend on any information about the workspace — if it does, then the package can't be used elsewhere (can't be published, etc.).

If it's for a tool or a test then the command cargo metadata might suit.


Thanks @kpreid. I wanted to use it like a module list. If I will not be able to use it in the publishing process as you mentioned, it is more rational to keep it in a separate file.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.