Skip to main content

Job

Struct Job 

Source
pub struct Job {
    pub input: String,
    pub kind: InputKind,
    pub phases: Vec<Phase>,
    pub output: Output,
    pub aux_base: Option<String>,
    pub stack_usage: Option<String>,
}
Expand description

Everything that has to happen to one input file.

Fields§

§input: String

The input path as written.

§kind: InputKind

What we decided it is.

§phases: Vec<Phase>

The phases to run, in order. Empty when the input goes straight to the linker.

§output: Output

Where the last phase writes.

§aux_base: Option<String>

What the files -save-temps keeps are called, without the suffix that says which one it is, or None when there is nothing to keep.

Nothing to keep is the usual case: the flag was not given, or it was and this job has no step whose result the compilation would have thrown away. -E -save-temps is the second of those, since the preprocessed text is the output and is already being written.

§stack_usage: Option<String>

Where -fstack-usage writes this job’s report, or None when it was not asked for or the job does not compile C.

gcc’s auxiliary base name with .su on the end, the same name -save-temps builds its files from: -c a.c -o out/x.o writes out/x.su, a bare -c sub/a.c writes a.su in the working directory, and a.c linked into out/prog writes out/prog-a.su. The rest of the rules are on aux_base in this file.

Implementations§

Source§

impl Job

Source

pub fn saved_text(&self) -> Option<String>

Where the preprocessed text goes when -save-temps asked for it to be kept.

None when the flag was not given, when the input arrives preprocessed already and there is no phase 4 to keep the result of, or when the text is this job’s own output and is being written anyway.

Source

pub fn saved_asm(&self) -> Option<String>

Where the assembly goes when -save-temps asked for it to be kept.

None for the same reasons, the last of them being -S: the assembly is the output there, and a copy of it under a second name is a file nobody asked for.

Trait Implementations§

Source§

impl Clone for Job

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 Job

Source§

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

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

impl Eq for Job

Source§

impl PartialEq for Job

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 Job

Auto Trait Implementations§

§

impl Freeze for Job

§

impl RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl UnsafeUnpin for Job

§

impl UnwindSafe for Job

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
Source§

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

Source§

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

Checks if this value is equivalent to the given key. Read more
Source§

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

Source§

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

Compare self to key and return true if they are equal.
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> 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.