pub enum ScheduleCondition {
Immediately {
situation: ProperFilename,
},
LocalNaiveTimeWindow {
priority: Option<Priority>,
situation: ProperFilename,
stop_start: Option<Vec<String>>,
repeatedly: bool,
move_when_time_window_ends: bool,
from: LocalNaiveTime,
to: LocalNaiveTime,
},
Inactive,
}Variants§
Immediately
Run jobs in this queue once right away
Fields
situation: ProperFilenameA description of the situation during which jobs in this queue are executed; all jobs of the same context (and same key) are grouped together and evaluated to “summary-” file names with this string appended. Meant to reflect conditions that might influence the results; e.g. “immediate” or “night”.
LocalNaiveTimeWindow
Run jobs in this queue between the given times on every day (except when one of the times is not valid or ambiguous on a given day due to DST changes). Jobs started before the end of the window are finished, though.
Fields
priority: Option<Priority>The priority of this queue–it is added to the priority of jobs in this queue. By default, 1.5 is used.
situation: ProperFilenameA description of the situation during which jobs in this queue are executed; all jobs of the same context (and same key) are grouped together and evaluated to “summary-” file names with this string appended. Meant to reflect conditions that might influence the results; e.g. “immediate” or “night”.
stop_start: Option<Vec<String>>A command and arguments, run with “stop” at the from
time and with “start” when done / at the to time.
repeatedly: boolIf true, run the BenchmarkingJobs in this queue until
their own count reaches zero or the time window runs out
(each job is rescheduled to the end of the queue after a
run, meaning the jobs are alternating). If false, each job
is run once and then moved to the next queue.
move_when_time_window_ends: boolIf true, when time runs out, move all remaining jobs to the next queue; if false, the jobs remain and are scheduled again in the same time window on the next day.
from: LocalNaiveTimeTimes in the time zone that the daemon is running with (to
change that, set TZ env var to area/city, or the default
time zone via dpkg-reconfigure).
to: LocalNaiveTimeInactive
A queue that is never run and never emptied, to add to the end of the queue pipeline to take up jobs that have been expelled from the second last queue, for informational purposes.
Implementations§
Source§impl ScheduleCondition
impl ScheduleCondition
pub const TIMED_QUEUE_DEFAULT_PRIORITY: Priority
Sourcepub fn is_inactive(&self) -> bool
pub fn is_inactive(&self) -> bool
Whether this queue will never run its jobs
pub fn time_range(&self) -> Option<(LocalNaiveTime, LocalNaiveTime)>
pub fn stop_start(&self) -> Option<&[String]>
Sourcepub fn move_when_time_window_ends(&self) -> bool
pub fn move_when_time_window_ends(&self) -> bool
Returns true if the condition offers that flag and it is true
pub fn situation(&self) -> Option<&ProperFilename>
pub fn priority(&self) -> Option<Priority>
Sourcepub fn is_runnable_at(
&self,
reference_time: DateTime<Local>,
) -> Option<Option<DateTimeRange<Local>>>
pub fn is_runnable_at( &self, reference_time: DateTime<Local>, ) -> Option<Option<DateTimeRange<Local>>>
Returns an optional time window (given if runnable due to being in this time window) if runnable
Trait Implementations§
Source§impl Debug for ScheduleCondition
impl Debug for ScheduleCondition
Source§impl<'de> Deserialize<'de> for ScheduleCondition
impl<'de> Deserialize<'de> for ScheduleCondition
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 Display for ScheduleCondition
impl Display for ScheduleCondition
Source§impl PartialEq for ScheduleCondition
impl PartialEq for ScheduleCondition
Source§impl Serialize for ScheduleCondition
impl Serialize for ScheduleCondition
impl StructuralPartialEq for ScheduleCondition
Auto Trait Implementations§
impl Freeze for ScheduleCondition
impl RefUnwindSafe for ScheduleCondition
impl Send for ScheduleCondition
impl Sync for ScheduleCondition
impl Unpin for ScheduleCondition
impl UnwindSafe for ScheduleCondition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);