aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorArnaud <[email protected]>2021-01-06 15:39:19 +0000
committerArnaud <[email protected]>2021-01-06 16:26:15 +0000
commit0abe487f1cf5d31c4d6b44961cd8b3e8fe49ed30 (patch)
treee33c9da94d7223c2833c8878dfa960eb67b36e9e /crates
parent7c3e163e90624bcc90a28119f06d5f38878ae432 (diff)
Document `project_model::PackageData`
This adds a description for `PackageData` and all its fields.
Diffstat (limited to 'crates')
-rw-r--r--crates/project_model/src/cargo_workspace.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs
index 1700cb8a7..006c66ae7 100644
--- a/crates/project_model/src/cargo_workspace.rs
+++ b/crates/project_model/src/cargo_workspace.rs
@@ -80,19 +80,35 @@ pub type Package = Idx<PackageData>;
80 80
81pub type Target = Idx<TargetData>; 81pub type Target = Idx<TargetData>;
82 82
83/// Information associated with a cargo crate
83#[derive(Debug, Clone, Eq, PartialEq)] 84#[derive(Debug, Clone, Eq, PartialEq)]
84pub struct PackageData { 85pub struct PackageData {
86 /// Version given in the `Cargo.toml`
85 pub version: String, 87 pub version: String,
88 /// Name as given in the `Cargo.toml`
86 pub name: String, 89 pub name: String,
90 /// Path containing the `Cargo.toml`
87 pub manifest: AbsPathBuf, 91 pub manifest: AbsPathBuf,
92 /// Targets provided by the crate (lib, bin, example, test, ...)
88 pub targets: Vec<Target>, 93 pub targets: Vec<Target>,
94 /// Is this package a member of the current workspace
89 pub is_member: bool, 95 pub is_member: bool,
96 /// List of packages this package depends on
90 pub dependencies: Vec<PackageDependency>, 97 pub dependencies: Vec<PackageDependency>,
98 /// Rust edition for this package
91 pub edition: Edition, 99 pub edition: Edition,
100 /// List of features to activate
92 pub features: Vec<String>, 101 pub features: Vec<String>,
102 /// List of config flags defined by this package's build script
93 pub cfgs: Vec<CfgFlag>, 103 pub cfgs: Vec<CfgFlag>,
104 /// List of cargo-related environment variables with their value
105 ///
106 /// If the package has a build script which defines environment variables,
107 /// they can also be found here.
94 pub envs: Vec<(String, String)>, 108 pub envs: Vec<(String, String)>,
109 /// Directory where a build script might place its output
95 pub out_dir: Option<AbsPathBuf>, 110 pub out_dir: Option<AbsPathBuf>,
111 /// Path to the proc-macro library file if this package exposes proc-macros
96 pub proc_macro_dylib_path: Option<AbsPathBuf>, 112 pub proc_macro_dylib_path: Option<AbsPathBuf>,
97} 113}
98 114