diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-10-26 08:36:16 +0100 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-12-22 11:58:30 +0100 |
| commit | ecc8032dcb7cd5fc8c3b8e468818ca235cfa9ff4 (patch) | |
| tree | 6f76f599281f8016c6bd94512b83624dcf9e9a1c /docs | |
| parent | 5de9723535506f625e093cbf9549b3ce0bf5940f (diff) | |
| download | meson-ecc8032dcb7cd5fc8c3b8e468818ca235cfa9ff4.tar.gz | |
modules: rust: implement workspace.subproject() and package.dependency()
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/markdown/Rust-module.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md index 1e8305d07..1126723ca 100644 --- a/docs/markdown/Rust-module.md +++ b/docs/markdown/Rust-module.md @@ -230,3 +230,38 @@ cargo_ws = rustmod.workspace(features: []) The first form says "use whatever features are configured," while the latter forms say "require this specific configuration," which may conflict with the parent project. + +## Workspace object + +### workspace.subproject() + +```meson +package = ws.subproject(package_name, api) +``` + +Returns a `package` object for managing a specific package within the workspace. + +Positional arguments: +- `package_name`: (`str`) The name of the package to retrieve +- `api`: (`str`, optional) The version constraints for the package in Cargo format + +## Package object + +The package object returned by `workspace.subproject()` provides methods +for working with individual packages in a Cargo workspace. + +### subproject.dependency() + +```meson +dep = subproject.dependency(...) +``` + +Returns a dependency object for the subproject that can be used with other Meson targets. + +*Note*: right now, this method is implemented on top of the normal Meson function +[[dependency]]; this is subject to change in future releases. It is recommended +to always retrieve a Cargo subproject's dependency object via this method. + +Keyword arguments: +- `rust_abi`: (`str`, optional) The ABI to use for the dependency. Valid values are + `'rust'`, `'c'`, or `'proc-macro'`. The package must support the specified ABI. |
