Job

Struct Job 

Source
pub struct Job {
Show 24 fields pub allow_failures: Option<bool>, pub allow_warnings: Option<bool>, pub analyzer: Option<AnalyzerRef>, pub apply_gitignore: Option<bool>, pub background: Option<bool>, pub command: Vec<String>, pub default_watch: Option<bool>, pub env: HashMap<String, String>, pub expand_env_vars: Option<bool>, pub extraneous_args: Option<bool>, pub grace_period: Option<Period>, pub hide_scrollbar: Option<bool>, pub ignore: Vec<String>, pub ignored_lines: Option<Vec<LinePattern>>, pub kill: Option<Vec<String>>, pub need_stdout: Option<bool>, pub on_change_strategy: Option<OnChangeStrategy>, pub on_failure: Option<Action>, pub on_success: Option<Action>, pub show_changes_count: Option<bool>, pub skin: BaconSkin, pub sound: SoundConfig, pub watch: Option<Vec<String>>, pub workdir: Option<PathBuf>,
}
Expand description

One of the possible jobs that bacon can run

Fields§

§allow_failures: Option<bool>

Whether to consider that we can have a success when we have test failures

§allow_warnings: Option<bool>

Whether to consider that we can have a success when we have warnings. This is especially useful for “cargo run” jobs

§analyzer: Option<AnalyzerRef>

The analyzer interpreting the output of the command, the standard cargo dedicated one if not provided

§apply_gitignore: Option<bool>

Whether gitignore rules must be applied

§background: Option<bool>

Whether to wait for the computation to finish before to display it on screen

This is true by default. Set it to false if you want the previous computation result to be replaced with the new one as soon as it starts.

§command: Vec<String>

The tokens making the command to execute (first one is the executable).

§default_watch: Option<bool>

Whether to apply the default watch list, which is ["src", "tests", "benches", "examples", "build.rs"]

This is true by default. Set it to false if you want to watch nothing, or only the directories you set in watch.

§env: HashMap<String, String>

Env vars to set for this job execution

§expand_env_vars: Option<bool>

Whether to expand environment variables in the command

§extraneous_args: Option<bool>

Whether to insert extraneous arguments provided by bacon or end users

Eg: –all-features or anything after – in bacon incantation

§grace_period: Option<Period>

Minimum delay to wait before restarting the job after a change is detected.

§hide_scrollbar: Option<bool>

Whether to hide the scrollbar

§ignore: Vec<String>

A list of glob patterns to ignore. Patterns starting with ! are negations that force-include matching paths, overriding other ignore rules (including .gitignore).

§ignored_lines: Option<Vec<LinePattern>>

Patterns of lines which should be ignored. Patterns of the prefs or bacon.toml can be overridden at the job

§kill: Option<Vec<String>>

A kill command. If not provided, SIGKILL is used.

§need_stdout: Option<bool>

Whether we need to capture stdout too (stderr is always captured)

§on_change_strategy: Option<OnChangeStrategy>

How to handle changes: either immediately kill the current job then restart it, or wait for the current job to finish before restarting it.

§on_failure: Option<Action>

The optional action to run when it’s not a success

§on_success: Option<Action>

The optional action to run when there’s no error, warning or test failures (depending on whether allow_warnings is true or false)

Could be made a vec in the future but that would involve explaining subtleties like the fact that those actions stop after the first one ending the mission or doing a refresh

§show_changes_count: Option<bool>

Whether to display how many files triggered the current run.

§skin: BaconSkin

Color overrides applied to the UI while the job runs.

§sound: SoundConfig

Notification sounds

§watch: Option<Vec<String>>

A list of directories that will be watched if the job is run on a package. src, examples, tests, and benches are implicitly included unless you set default_watch to false.

§workdir: Option<PathBuf>

An optional working directory for the job command, which would override the package directory.

Implementations§

Source§

impl Job

Source

pub fn from_alias(alias_name: &str, settings: &Settings) -> Self

Build a Job for a cargo alias

Source

pub fn allow_failures(&self) -> bool

Source

pub fn allow_warnings(&self) -> bool

Source

pub fn background(&self) -> bool

Source

pub fn default_watch(&self) -> bool

Source

pub fn expand_env_vars(&self) -> bool

Source

pub fn hide_scrollbar(&self) -> bool

Source

pub fn need_stdout(&self) -> bool

Source

pub fn extraneous_args(&self) -> bool

Source

pub fn show_changes_count(&self) -> bool

Source

pub fn grace_period(&self) -> Period

Source

pub fn on_change_strategy(&self) -> OnChangeStrategy

Source

pub fn apply(&mut self, job: &Job)

Trait Implementations§

Source§

impl Clone for Job

Source§

fn clone(&self) -> Job

Returns a duplicate 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 Job

Source§

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

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

impl Default for Job

Source§

fn default() -> Job

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Job

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Job

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Job

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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 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<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T