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: BaconSkinColor overrides applied to the UI while the job runs.
sound: SoundConfigNotification 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
impl Job
Sourcepub fn from_alias(alias_name: &str, settings: &Settings) -> Self
pub fn from_alias(alias_name: &str, settings: &Settings) -> Self
Build a Job for a cargo alias
pub fn allow_failures(&self) -> bool
pub fn allow_warnings(&self) -> bool
pub fn background(&self) -> bool
pub fn default_watch(&self) -> bool
pub fn expand_env_vars(&self) -> bool
pub fn hide_scrollbar(&self) -> bool
pub fn need_stdout(&self) -> bool
pub fn extraneous_args(&self) -> bool
pub fn show_changes_count(&self) -> bool
pub fn grace_period(&self) -> Period
pub fn on_change_strategy(&self) -> OnChangeStrategy
pub fn apply(&mut self, job: &Job)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Job
impl<'de> Deserialize<'de> for Job
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Job
impl JsonSchema for Job
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more