pub struct ProjectWorkspace {
pub kind: ProjectWorkspaceKind,
pub sysroot: Sysroot,
pub rustc_cfg: Vec<CfgAtom>,
pub toolchain: Option<Version>,
pub target_layout: TargetLayoutLoadResult,
pub cfg_overrides: CfgOverrides,
pub extra_includes: Vec<AbsPathBuf>,
pub set_test: bool,
}Fields§
§kind: ProjectWorkspaceKind§sysroot: SysrootThe sysroot loaded for this workspace.
rustc_cfg: Vec<CfgAtom>Holds cfg flags for the current target. We get those by running
rustc --print cfg.
toolchain: Option<Version>The toolchain version used by this workspace.
target_layout: TargetLayoutLoadResultThe target data layout queried for workspace.
cfg_overrides: CfgOverridesA set of cfg overrides for this workspace.
extra_includes: Vec<AbsPathBuf>Additional includes to add for the VFS.
set_test: boolSet cfg(test) for local crates
Implementations§
Source§impl ProjectWorkspace
impl ProjectWorkspace
pub fn load( manifest: ProjectManifest, config: &CargoConfig, progress: &dyn Fn(String), ) -> Result<ProjectWorkspace>
pub fn load_inline( project_json: ProjectJson, config: &CargoConfig, progress: &dyn Fn(String), ) -> ProjectWorkspace
pub fn load_detached_file( detached_file: &ManifestPath, config: &CargoConfig, ) -> Result<ProjectWorkspace>
pub fn load_detached_files( detached_files: Vec<ManifestPath>, config: &CargoConfig, ) -> Vec<Result<ProjectWorkspace>> ⓘ
Sourcepub fn run_build_scripts(
&self,
config: &CargoConfig,
progress: &dyn Fn(String),
) -> Result<WorkspaceBuildScripts>
pub fn run_build_scripts( &self, config: &CargoConfig, progress: &dyn Fn(String), ) -> Result<WorkspaceBuildScripts>
Runs the build scripts for this ProjectWorkspace.
Sourcepub fn run_all_build_scripts(
workspaces: &[ProjectWorkspace],
config: &CargoConfig,
progress: &dyn Fn(String),
working_directory: &AbsPathBuf,
) -> Vec<Result<WorkspaceBuildScripts>> ⓘ
pub fn run_all_build_scripts( workspaces: &[ProjectWorkspace], config: &CargoConfig, progress: &dyn Fn(String), working_directory: &AbsPathBuf, ) -> Vec<Result<WorkspaceBuildScripts>> ⓘ
Runs the build scripts for the given ProjectWorkspaces. Depending on the invocation
strategy this may run a single build process for all project workspaces.
pub fn set_build_scripts(&mut self, bs: WorkspaceBuildScripts)
pub fn manifest_or_root(&self) -> &AbsPath
pub fn workspace_root(&self) -> &AbsPath
pub fn manifest(&self) -> Option<&ManifestPath>
pub fn buildfiles(&self) -> Vec<AbsPathBuf>
pub fn find_sysroot_proc_macro_srv(&self) -> Result<AbsPathBuf>
Sourcepub fn to_roots(&self) -> Vec<PackageRoot>
pub fn to_roots(&self) -> Vec<PackageRoot>
Returns the roots for the current ProjectWorkspace
The return type contains the path and whether or not
the root is a member of the current workspace
pub fn n_packages(&self) -> usize
pub fn to_crate_graph( &self, load: FileLoader<'_>, extra_env: &FxHashMap<String, Option<String>>, ) -> (CrateGraphBuilder, ProcMacroPaths)
pub fn eq_ignore_build_data(&self, other: &Self) -> bool
Trait Implementations§
Source§impl Clone for ProjectWorkspace
impl Clone for ProjectWorkspace
Source§fn clone(&self) -> ProjectWorkspace
fn clone(&self) -> ProjectWorkspace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProjectWorkspace
impl RefUnwindSafe for ProjectWorkspace
impl Send for ProjectWorkspace
impl Sync for ProjectWorkspace
impl Unpin for ProjectWorkspace
impl UnwindSafe for ProjectWorkspace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more