Struct SysrootBuilder

Source
pub struct SysrootBuilder<'a> { /* private fields */ }
Expand description

Information about a to-be-created sysroot.

Implementations§

Source§

impl<'a> SysrootBuilder<'a>

Source

pub fn new(sysroot_dir: &Path, target: impl Into<OsString>) -> Self

Prepare to create a new sysroot in the given folder (that folder should later be passed to rustc via --sysroot), for the given target.

Source

pub fn build_mode(self, build_mode: BuildMode) -> Self

Sets the build mode (regular build vs check-only build).

Source

pub fn sysroot_config(self, sysroot_config: SysrootConfig) -> Self

Sets the sysroot configuration (which parts of the sysroot to build and with which features).

Source

pub fn rustflag(self, rustflag: impl Into<OsString>) -> Self

Appends the given flag.

Source

pub fn rustflags( self, rustflags: impl IntoIterator<Item = impl Into<OsString>>, ) -> Self

Appends the given flags.

Source

pub fn cargo(self, cargo: Command) -> Self

Sets the cargo command to call.

This will be invoked with output(), so if stdout/stderr should be inherited then that needs to be set explicitly.

Source

pub fn rustc_version(self, rustc_version: VersionMeta) -> Self

Sets the rustc version information (in case the user has that available).

Source

pub fn when_build_required( self, when_build_required: impl FnOnce() + 'a, ) -> Self

Sets the hook that will be called if we don’t have a cached sysroot available and a new one will be compiled.

Source

pub fn build_from_source(self, src_dir: &Path) -> Result<SysrootStatus>

Build the self sysroot from the given sources.

src_dir must be the library source folder, i.e., the one that contains std/Cargo.toml.

Auto Trait Implementations§

§

impl<'a> Freeze for SysrootBuilder<'a>

§

impl<'a> !RefUnwindSafe for SysrootBuilder<'a>

§

impl<'a> !Send for SysrootBuilder<'a>

§

impl<'a> !Sync for SysrootBuilder<'a>

§

impl<'a> Unpin for SysrootBuilder<'a>

§

impl<'a> !UnwindSafe for SysrootBuilder<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.