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
pub fn discover(dir: &AbsPath, extra_env: &FxHashMap<String, String>) -> 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
pub fn discover_sysroot_src_dir(sysroot_dir: AbsPathBuf) -> Sysroot
pub fn discover_rustc_src(&self) -> Option<ManifestPath>
pub fn new( sysroot_dir: Option<AbsPathBuf>, sysroot_src_dir: Option<AbsPathBuf>, ) -> Sysroot
Sourcepub fn tool(&self, tool: Tool, current_dir: impl AsRef<Path>) -> Command
pub fn tool(&self, tool: Tool, current_dir: impl AsRef<Path>) -> 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_workspace( &mut self, sysroot_source_config: &SysrootSourceWorkspaceConfig, )
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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