Struct clang_sys::support::Clang

source ·
pub struct Clang {
    pub path: PathBuf,
    pub version: Option<CXVersion>,
    pub c_search_paths: Option<Vec<PathBuf>>,
    pub cpp_search_paths: Option<Vec<PathBuf>>,
}
Expand description

A clang executable.

Fields§

§path: PathBuf

The path to this clang executable.

§version: Option<CXVersion>

The version of this clang executable if it could be parsed.

§c_search_paths: Option<Vec<PathBuf>>

The directories searched by this clang executable for C headers if they could be parsed.

§cpp_search_paths: Option<Vec<PathBuf>>

The directories searched by this clang executable for C++ headers if they could be parsed.

Implementations§

source§

impl Clang

source

pub fn find(path: Option<&Path>, args: &[String]) -> Option<Clang>

Returns a clang executable if one can be found.

If the CLANG_PATH environment variable is set, that is the instance of clang used. Otherwise, a series of directories are searched. First, if a path is supplied, that is the first directory searched. Then, the directory returned by llvm-config --bindir is searched. On macOS systems, xcodebuild -find clang will next be queried. Last, the directories in the system’s PATH are searched.

Cross-compilation

If target arguments are provided (e.g., -target followed by a target like x86_64-unknown-linux-gnu) then this method will prefer a target-prefixed instance of clang (e.g., x86_64-unknown-linux-gnu-clang for the above example).

Trait Implementations§

source§

impl Clone for Clang

source§

fn clone(&self) -> Clang

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Clang

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Clang

§

impl Send for Clang

§

impl Sync for Clang

§

impl Unpin for Clang

§

impl UnwindSafe for Clang

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · 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> ToOwned for Twhere
T: Clone,

§

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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.