Skip to main content

Sysroot

Struct Sysroot 

Source
pub struct Sysroot {
    root: Option<AbsPathBuf>,
    rust_lib_src_root: Option<AbsPathBuf>,
    workspace: RustLibSrcWorkspace,
    error: Option<String>,
}

Fields§

§root: Option<AbsPathBuf>§rust_lib_src_root: Option<AbsPathBuf>§workspace: RustLibSrcWorkspace§error: Option<String>

Implementations§

Source§

impl Sysroot

Source

pub const fn empty() -> Sysroot

Source

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

Source

pub fn rust_lib_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

Source

pub fn is_rust_lib_src_empty(&self) -> bool

Source

pub fn error(&self) -> Option<&str>

Source

pub fn metadata_error(&self) -> Option<&str>

Source

pub fn num_packages(&self) -> usize

Source

pub(crate) fn workspace(&self) -> &RustLibSrcWorkspace

Source§

impl Sysroot

Source

pub fn discover( dir: &AbsPath, extra_env: &FxHashMap<String, Option<String>>, ) -> Sysroot

Attempts to discover the toolchain’s sysroot from the given dir.

Source

pub fn discover_with_src_override( current_dir: &AbsPath, extra_env: &FxHashMap<String, Option<String>>, rust_lib_src_dir: AbsPathBuf, ) -> Sysroot

Source

pub fn discover_rust_lib_src_dir(sysroot_dir: AbsPathBuf) -> Sysroot

Source

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

Source

pub fn new( sysroot_dir: Option<AbsPathBuf>, rust_lib_src_dir: Option<AbsPathBuf>, ) -> Sysroot

Source

pub fn tool( &self, tool: Tool, current_dir: impl AsRef<Path>, envs: &FxHashMap<String, Option<String>>, ) -> Command

Returns a command to run a tool preferring the cargo proxies if the sysroot exists.

Source

pub fn tool_path( &self, tool: Tool, current_dir: impl AsRef<Path>, envs: &Env, ) -> Utf8PathBuf

Source

pub fn discover_proc_macro_srv(&self) -> Option<Result<AbsPathBuf>>

Source

fn assemble( sysroot_dir: Option<Result<AbsPathBuf, Error>>, rust_lib_src_dir: Option<Result<AbsPathBuf, Error>>, ) -> Sysroot

Source

pub fn load_workspace( &self, sysroot_source_config: &RustSourceWorkspaceConfig, no_deps: bool, progress: &dyn Fn(String), ) -> Option<RustLibSrcWorkspace>

Source

pub fn set_workspace(&mut self, workspace: RustLibSrcWorkspace)

Source

fn load_library_via_cargo( &self, library_manifest: &ManifestPath, current_dir: &AbsPath, cargo_config: &CargoMetadataConfig, no_deps: bool, progress: &dyn Fn(String), ) -> Result<RustLibSrcWorkspace>

Trait Implementations§

Source§

impl Clone for Sysroot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Sysroot

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Sysroot

Source§

impl PartialEq for Sysroot

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Sysroot

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, dest: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 + Send + Sync> for T
where T: Any + Send + Sync,

§

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

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> for T
where T: Any,

§

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

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
§

impl<T> Lookup<T> for T

§

fn into_owned(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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