Enum ra_ap_project_model::ProjectWorkspace [−][src]
pub enum ProjectWorkspace {
Cargo {
cargo: CargoWorkspace,
build_scripts: WorkspaceBuildScripts,
sysroot: Option<Sysroot>,
rustc: Option<CargoWorkspace>,
rustc_cfg: Vec<CfgFlag>,
cfg_overrides: CfgOverrides,
},
Json {
project: ProjectJson,
sysroot: Option<Sysroot>,
rustc_cfg: Vec<CfgFlag>,
},
DetachedFiles {
files: Vec<AbsPathBuf>,
sysroot: Sysroot,
rustc_cfg: Vec<CfgFlag>,
},
}
Variants
Cargo
Fields
cargo: CargoWorkspace
build_scripts: WorkspaceBuildScripts
rustc: Option<CargoWorkspace>
rustc_cfg: Vec<CfgFlag>
Holds cfg flags for the current target. We get those by running
rustc --print cfg
.
FIXME: make this a per-crate map, as, eg, build.rs might have a different target.
cfg_overrides: CfgOverrides
Project workspace was discovered by running cargo metadata
and rustc --print sysroot
.
Json
Project workspace was manually specified using a rust-project.json
file.
DetachedFiles
Project with a set of disjoint files, not belonging to any particular workspace. Backed by basic sysroot crates for basic completion and highlighting.
Implementations
pub fn load(
manifest: ProjectManifest,
config: &CargoConfig,
progress: &dyn Fn(String)
) -> Result<ProjectWorkspace>
pub fn load_inline(
project_json: ProjectJson,
target: Option<&str>
) -> Result<ProjectWorkspace>
pub fn run_build_scripts(
&self,
config: &CargoConfig,
progress: &dyn Fn(String)
) -> Result<WorkspaceBuildScripts>
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 to_crate_graph(
&self,
load_proc_macro: &mut dyn FnMut(&AbsPath) -> Vec<ProcMacro>,
load: &mut dyn FnMut(&AbsPath) -> Option<FileId>
) -> CrateGraph
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ProjectWorkspace
impl Send for ProjectWorkspace
impl Sync for ProjectWorkspace
impl Unpin for ProjectWorkspace
impl UnwindSafe for ProjectWorkspace
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more