pub struct ProjectContext {
pub metadata: Metadata,
pub cargo_config: Option<Table>,
pub cargo_toml: Table,
pub rustc_version: Option<RustcVersion>,
pub host_triple: Option<String>,
pub installed_linkers: InstalledLinkers,
pub env_vars: EnvVars,
pub os: Os,
}Expand description
All project data gathered up front. Checks are pure functions over this.
Fields§
§metadata: MetadataOutput of cargo metadata for the project.
cargo_config: Option<Table>Parsed .cargo/config.toml, if present.
cargo_toml: TableParsed workspace-root Cargo.toml.
rustc_version: Option<RustcVersion>Parsed rustc version, if it could be determined.
host_triple: Option<String>The host target triple reported by rustc -vV, e.g.
aarch64-apple-darwin. None if it could not be parsed.
installed_linkers: InstalledLinkersWhich fast linkers were found on PATH.
env_vars: EnvVarsBuild-relevant environment variables.
os: OsThe operating system build-rx is running on.
Implementations§
Source§impl ProjectContext
impl ProjectContext
Sourcepub fn gather(manifest_path: Option<&Path>) -> Result<Self>
pub fn gather(manifest_path: Option<&Path>) -> Result<Self>
Gather all project data.
manifest_path selects the project; None uses the current directory.
Sourcepub fn project_name(&self) -> &str
pub fn project_name(&self) -> &str
Get the project name from metadata.
Sourcepub fn is_workspace(&self) -> bool
pub fn is_workspace(&self) -> bool
Check if this is a workspace with multiple members.
Sourcepub fn declared_msrv(&self) -> Option<(u32, u32)>
pub fn declared_msrv(&self) -> Option<(u32, u32)>
The project’s declared minimum supported Rust version (rust-version),
as (major, minor), read from [package] or [workspace.package].
Returns None when no MSRV is declared.