project_model

Struct ProjectWorkspace

Source
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>,
}

Fields§

§kind: ProjectWorkspaceKind§sysroot: Sysroot

The 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: TargetLayoutLoadResult

The target data layout queried for workspace.

§cfg_overrides: CfgOverrides

A set of cfg overrides for this workspace.

§extra_includes: Vec<AbsPathBuf>

Additional includes to add for the VFS.

Implementations§

Source§

impl ProjectWorkspace

Source

pub fn load( manifest: ProjectManifest, config: &CargoConfig, progress: &dyn Fn(String), ) -> Result<ProjectWorkspace>

Source

pub fn load_inline( project_json: ProjectJson, config: &CargoConfig, ) -> ProjectWorkspace

Source

pub fn load_detached_file( detached_file: &ManifestPath, config: &CargoConfig, ) -> Result<ProjectWorkspace>

Source

pub fn load_detached_files( detached_files: Vec<ManifestPath>, config: &CargoConfig, ) -> Vec<Result<ProjectWorkspace>>

Source

pub fn run_build_scripts( &self, config: &CargoConfig, progress: &dyn Fn(String), ) -> Result<WorkspaceBuildScripts>

Runs the build scripts for this ProjectWorkspace.

Source

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.

Source

pub fn set_build_scripts(&mut self, bs: WorkspaceBuildScripts)

Source

pub fn manifest_or_root(&self) -> &AbsPath

Source

pub fn workspace_root(&self) -> &AbsPath

Source

pub fn manifest(&self) -> Option<&ManifestPath>

Source

pub fn find_sysroot_proc_macro_srv(&self) -> Result<AbsPathBuf>

Source

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

Source

pub fn n_packages(&self) -> usize

Source

pub fn to_crate_graph( &self, load: FileLoader<'_>, extra_env: &FxHashMap<String, String>, ) -> (CrateGraph, ProcMacroPaths)

Source

pub fn eq_ignore_build_data(&self, other: &Self) -> bool

Source

pub fn is_json(&self) -> bool

Returns true if the project workspace is Json.

Trait Implementations§

Source§

impl Clone for ProjectWorkspace

Source§

fn clone(&self) -> ProjectWorkspace

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProjectWorkspace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Sync + Send> for T
where T: Any + Send + Sync,

§

fn into_box(self) -> Box<dyn Any + Sync + Send>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more