pub struct Sysroot { /* private fields */ }Implementations§
Source§impl Sysroot
impl Sysroot
pub const fn empty() -> Sysroot
Sourcepub fn root(&self) -> Option<&AbsPath>
pub fn root(&self) -> Option<&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 error(&self) -> Option<&str>
pub fn num_packages(&self) -> usize
Source§impl Sysroot
impl Sysroot
Sourcepub fn discover(
dir: &AbsPath,
extra_env: &FxHashMap<String, String>,
sysroot_query_metadata: SysrootQueryMetadata,
) -> Sysroot
pub fn discover( dir: &AbsPath, extra_env: &FxHashMap<String, String>, sysroot_query_metadata: SysrootQueryMetadata, ) -> Sysroot
Attempts to discover the toolchain’s sysroot from the given dir.
pub fn discover_with_src_override( current_dir: &AbsPath, extra_env: &FxHashMap<String, String>, sysroot_src_dir: AbsPathBuf, sysroot_query_metadata: SysrootQueryMetadata, ) -> Sysroot
pub fn discover_sysroot_src_dir( sysroot_dir: AbsPathBuf, sysroot_query_metadata: SysrootQueryMetadata, ) -> Sysroot
pub fn discover_rustc_src(&self) -> Option<ManifestPath>
Sourcepub fn tool(&self, tool: Tool) -> Command
pub fn tool(&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: Option<AbsPathBuf>, sysroot_src_dir: Option<AbsPathBuf>, sysroot_query_metadata: SysrootQueryMetadata, ) -> Sysroot
Trait Implementations§
impl Eq for Sysroot
impl StructuralPartialEq 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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