pub struct CheckedCondition {
pub condition: Condition,
pub satisfied: bool,
pub last_check: Option<DateTime<Utc>>,
pub message: Option<String>,
}Expand description
A boundary condition paired with its current satisfaction state.
Fields§
§condition: Condition§satisfied: bool§last_check: Option<DateTime<Utc>>§message: Option<String>Implementations§
Source§impl CheckedCondition
impl CheckedCondition
Sourcepub fn all_satisfied(checked: &[Self]) -> bool
pub fn all_satisfied(checked: &[Self]) -> bool
True iff every CheckedCondition in the slice has
satisfied == true — the ONE-line collapse of the paired
checked.iter().all(|c| c.satisfied) incantation the
reconciler’s precondition + postcondition boundary gates both
spelled by hand pre-lift.
Pre-lift the SAME .iter().all(|c| c.satisfied) chain was
hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication threshold in tatara-reconciler::phase_machine,
each walking the SAME Vec<CheckedCondition> → bool
projection to gate a phase transition on a boundary predicate:
handle_execing— the PROVE-phase precondition gate that stays in Execing (heartbeat requeue) while any precondition remains unsatisfied and proceeds to RENDER only when every precondition holds.handle_running— the VERIFY-phase postcondition gate that stays in Running (heartbeat requeue) while any postcondition remains unsatisfied and advances to Attested only when every postcondition holds.
Both sites walked the SAME Iterator::all short-circuit on the
SAME bool slot of the SAME struct. Post-lift both consumers
name the slice ONCE and route through this ONE primitive; the
vacuous-truth corner (empty slice → true, matching
Iterator::all’s empty-input identity) sits at ONE substrate
site so a future normalization (a per-slot weight overlay, a
per-kind override that treats Warn-severity failures as
satisfied, a compliance-baseline gate that requires N-of-M
rather than all-of-M) lands at ONE substrate function and both
downstream phase gates inherit the upgrade mechanically.
Return-form axis: bool — the exact type each phase gate
pre-lift bound at let all_pass = <chain>; and immediately
consumed in a !all_pass short-circuit + a message slot’s
ternary branch. The &[Self] argument accepts every pre-lift
slice provenance verbatim: a &Vec<CheckedCondition> (both
pre-lift sites had the Vec on the stack from
[crate::phase_machine::evaluate_conditions]’s owned return)
coerces through auto-deref, so no callsite has to change its
upstream provenance to route through the primitive.
Peer to the sibling projection Self::satisfied on the (row
scope × predicate) axis pair: satisfied is the per-row
projection; all_satisfied is the slice-wide fold of the same
bit. Both live on CheckedCondition so a future rename or
per-slot normalization travels through the same owner without
splitting between “per-row” and “slice-wide” call sinks.
Return-shape pin lives at
[tests::checked_condition_all_satisfied_matches_pre_lift_iter_all_chain_shape]
so a regression that flipped the fold direction (any for
all), inverted the bit (!c.satisfied), or reshaped the
return form (an owned Vec<bool> instead of the folded bool)
fails-loudly here rather than as silent operator-facing skew
between the pre-lift if !all_pass { requeue } gate and the
post-lift call — every downstream consumer would still
short-circuit but on inverted semantics.
Theory grounding: THEORY.md §VI.1 (generation over composition
— the 1-line .iter().all(...) chain recurred at two hand-
authored sites past the ≥ 2 duplication trigger, and is lifted
to ONE typed fold here). THEORY.md §II.1 invariant 5
(composition preserves proofs — the empty-slice vacuous-truth
corner + the fold direction + the projected bit’s polarity all
bind at ONE substrate site, so a regression across any of the
three surfaces at [tests::checked_condition_all_satisfied_*]
pin rather than as silent gate-flip at every downstream phase
handler).
Trait Implementations§
Source§impl Clone for CheckedCondition
impl Clone for CheckedCondition
Source§fn clone(&self) -> CheckedCondition
fn clone(&self) -> CheckedCondition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CheckedCondition
impl Debug for CheckedCondition
Source§impl<'de> Deserialize<'de> for CheckedCondition
impl<'de> Deserialize<'de> for CheckedCondition
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 CheckedCondition
impl JsonSchema for CheckedCondition
Source§fn schema_name() -> String
fn schema_name() -> String
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 is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for CheckedCondition
impl RefUnwindSafe for CheckedCondition
impl Send for CheckedCondition
impl Sync for CheckedCondition
impl Unpin for CheckedCondition
impl UnsafeUnpin for CheckedCondition
impl UnwindSafe for CheckedCondition
Blanket Implementations§
impl<T> AppData for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
impl<T> AppDataResponse for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> OptionalSend for T
impl<T> OptionalSync for T
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>
renamed to 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);