Struct ra_ap_project_model::Sysroot
source · pub struct Sysroot { /* private fields */ }
Implementations§
source§impl Sysroot
impl Sysroot
sourcepub fn root(&self) -> &AbsPath
pub fn root(&self) -> &AbsPath
Returns sysroot “root” directory, where bin/
, etc/
, lib/
, libexec/
subfolder live, like:
$HOME/.rustup/toolchains/nightly-2022-07-23-x86_64-unknown-linux-gnu
sourcepub fn src_root(&self) -> Option<&AbsPath>
pub fn src_root(&self) -> Option<&AbsPath>
Returns the sysroot “source” directory, where stdlib sources are located, like:
$HOME/.rustup/toolchains/nightly-2022-07-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library
pub fn is_empty(&self) -> bool
pub fn loading_warning(&self) -> Option<String>
pub fn check_has_core(&self) -> Result<(), String>
pub fn num_packages(&self) -> usize
source§impl Sysroot
impl Sysroot
sourcepub fn discover(
dir: &AbsPath,
extra_env: &FxHashMap<String, String>,
metadata: bool
) -> Result<Sysroot>
pub fn discover( dir: &AbsPath, extra_env: &FxHashMap<String, String>, metadata: bool ) -> Result<Sysroot>
Attempts to discover the toolchain’s sysroot from the given dir
.
pub fn discover_no_source( dir: &AbsPath, extra_env: &FxHashMap<String, String> ) -> Result<Sysroot>
pub fn discover_with_src_override( current_dir: &AbsPath, extra_env: &FxHashMap<String, String>, src: AbsPathBuf, metadata: bool ) -> Result<Sysroot>
pub fn discover_rustc_src(&self) -> Option<ManifestPath>
pub fn with_sysroot_dir( sysroot_dir: AbsPathBuf, metadata: bool ) -> Result<Sysroot>
sourcepub fn tool(sysroot: Option<&Self>, tool: Tool) -> Command
pub fn tool(sysroot: Option<&Self>, tool: Tool) -> Command
Returns a command to run a tool preferring the cargo proxies if the sysroot exists.
pub fn discover_proc_macro_srv(&self) -> Result<AbsPathBuf>
pub fn load( sysroot_dir: AbsPathBuf, sysroot_src_dir: Option<Result<AbsPathBuf, Error>>, metadata: bool ) -> Sysroot
Trait Implementations§
source§impl PartialEq for Sysroot
impl PartialEq for Sysroot
impl Eq for Sysroot
Auto Trait Implementations§
impl Freeze for Sysroot
impl RefUnwindSafe for Sysroot
impl Send for Sysroot
impl Sync for Sysroot
impl Unpin for Sysroot
impl UnwindSafe for Sysroot
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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