You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/markdown/Rust-module.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,3 +203,36 @@ are specified.
203
203
204
204
When `features` is provided without `default_features`, the 'default' feature is
205
205
automatically included.
206
+
207
+
#### workspace.subproject()
208
+
209
+
```meson
210
+
package = ws.subproject(package_name, ...)
211
+
```
212
+
213
+
Returns a `package` object for managing a specific package within the workspace.
214
+
215
+
Positional arguments:
216
+
- `package_name`: (`str`) The name of the package to retrieve
217
+
218
+
Keyword arguments:
219
+
- `version`: (`list[str]`, optional) List of version constraints for the package
220
+
221
+
## Package object
222
+
223
+
The package object returned by `workspace.subproject()` provides methods for working with individual packages in a Cargo workspace.
224
+
225
+
### package.dependency()
226
+
227
+
```meson
228
+
dep = package.dependency(...)
229
+
```
230
+
231
+
Returns a dependency object for the package that can be used with other Meson targets.
232
+
233
+
*Note*: right now, this method is implemented on top of the normal Meson function
234
+
[[dependency]]; this is subject to change in future releases. It is recommended
235
+
to always retrieve a Cargo subproject's dependency object via this method.
236
+
237
+
Keyword arguments:
238
+
- `rust_abi`: (`str`, optional) The ABI to use for the dependency. Valid values are `'rust'` (default), `'c'`, or `'proc-macro'`. The package must support the specified ABI.
0 commit comments