Struct Rustc

Source
pub struct Rustc(/* private fields */);
Expand description

Provides utilities for interacting with the Rust compiler through Cargo build instructions.

Implementations§

Source§

impl Rustc

Passes a single linker argument to the Rust compiler.

Passes a linker argument for a specific binary target.

Passes a linker argument for all binary targets.

Links a library with the specified name.

Passes a linker argument specifically for test builds.

Passes a linker argument specifically for example builds.

Specifies a directory for the Rust compiler to search for libraries.

Source

pub fn flags(flags: impl AsRef<str>)

Passes additional compiler flags to Rust compiler.

Source

pub fn cfg<'a>(key: impl AsRef<str>, value: impl Into<Option<&'a str>>)

Configures a conditional compilation flag with an optional value.

Source

pub fn check_cfg(cfg: impl AsRef<str>)

Checks the validity of a conditional compilation flag.

Source

pub fn env(var: impl AsRef<str>, value: impl AsRef<str>)

Sets an environment variable for the build script.

Passes a linker argument specifically for cdylib builds.

Auto Trait Implementations§

§

impl Freeze for Rustc

§

impl RefUnwindSafe for Rustc

§

impl Send for Rustc

§

impl Sync for Rustc

§

impl Unpin for Rustc

§

impl UnwindSafe for Rustc

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.