File tree 1 file changed +8
-1
lines changed 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 3
3
A * workspace* is a collection of one or more packages that share common
4
4
dependency resolution (with a shared ` Cargo.lock ` ), output directory, and
5
5
various settings such as profiles. Packages that are part of a workspaces are
6
- called * workspace members* .
6
+ called * workspace members* . There are two flavours of workspaces: as root
7
+ package or as virtual manifest.
8
+
9
+ ### Root package
7
10
8
11
A workspace can be created by adding a [ ` [workspace] `
9
12
section] ( #the-workspace-section ) to ` Cargo.toml ` . This can be added to a
10
13
` Cargo.toml ` that already defines a ` [package] ` , in which case the package is
11
14
the * root package* of the workspace. The * workspace root* is the directory
12
15
where the workspace's ` Cargo.toml ` is located.
13
16
17
+ ### Virtual manifest
18
+
14
19
Alternatively, a ` Cargo.toml ` file can be created with a ` [workspace] ` section
15
20
but without a [ ` [package] ` section] [ package ] . This is called a * virtual
16
21
manifest* . This is typically useful when there isn't a "primary" package, or
17
22
you want to keep all the packages organized in separate directories.
18
23
24
+ ### Key features
25
+
19
26
The key points of workspaces are:
20
27
21
28
* All packages share a common ` Cargo.lock ` file which resides in the
You can’t perform that action at this time.
0 commit comments