summaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-10-24 10:24:45 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-12-22 11:59:07 +0100
commit7a1aa179087a274d6f6b13c2c666043ac9760ea5 (patch)
treeb9bf5eed53e6a3ff41dee74b6429ef2916dae37a /docs/markdown
parent9752def1c96eb32dc37c32398a0fe8802392fbc9 (diff)
downloadmeson-7a1aa179087a274d6f6b13c2c666043ac9760ea5.tar.gz
modules: rust: implement workspace.package()
Note that, as shown in the testcase, package() works in the subproject as well. This means that in the future the Cargo code generator can be changed to reduce the amount of generated code and instead rely on the package object. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Rust-module.md29
1 files changed, 21 insertions, 8 deletions
diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md
index fbe65f1b6..ba500e7ee 100644
--- a/docs/markdown/Rust-module.md
+++ b/docs/markdown/Rust-module.md
@@ -241,6 +241,19 @@ packages = ws.packages()
Returns a list of package names in the workspace.
+### workspace.package()
+
+```meson
+pkg = ws.package([package_name])
+```
+
+Returns a package object for the given package member. If empty, returns
+the object for the root package.
+
+Arguments:
+- `package_name`: (str, optional) Name of the package; not needed for the
+ root package of a workspace
+
### workspace.subproject()
```meson
@@ -258,15 +271,15 @@ Positional arguments:
The package object returned by `workspace.subproject()` provides methods
for working with individual packages in a Cargo workspace.
-### subproject.name()
+### package.name(), subproject.name()
```meson
name = pkg.name()
```
-Returns the name of the subproject.
+Returns the name of a package or subproject.
-### subproject.version()
+### package.version(), subproject.version()
```meson
version = pkg.version()
@@ -274,7 +287,7 @@ version = pkg.version()
Returns the normalized version number of the subproject.
-### subproject.api()
+### package.api(), subproject.api()
```meson
api = pkg.api()
@@ -283,21 +296,21 @@ api = pkg.api()
Returns the API version of the subproject, that is the version up to the first
nonzero element.
-### subproject.features()
+### package.features(), subproject.features()
```meson
features = pkg.features()
```
-Returns selected features for a specific subproject.
+Returns selected features for a specific package or subproject.
-### subproject.all_features()
+### package.all_features(), subproject.all_features()
```meson
all_features = pkg.all_features()
```
-Returns all defined features for a specific subproject.
+Returns all defined features for a specific package or subproject.
### subproject.dependency()