pub struct SignalPolicy {
pub sigterm_grace_seconds: u32,
pub sigkill_force: bool,
pub sighup_strategy: SighupStrategy,
pub start_suspended: bool,
}Expand description
Signal policy — how the Process responds to signals.
Fields§
§sigterm_grace_seconds: u32Grace before escalating SIGTERM → SIGKILL.
sigkill_force: boolPermit force-reap via SIGKILL (default: allow).
sighup_strategy: SighupStrategyHow SIGHUP is handled.
start_suspended: boolStart suspended — requires SIGCONT to transition past Forking.
Implementations§
Source§impl SignalPolicy
impl SignalPolicy
Sourcepub fn has_sighup_strategy(&self, kind: SighupStrategy) -> bool
pub fn has_sighup_strategy(&self, kind: SighupStrategy) -> bool
Closed-set-driven presence probe — does this SignalPolicy carry
the given SighupStrategy discriminator on its
Self::sighup_strategy slot? The ONE substrate primitive that
owns the (SignalPolicy, SighupStrategy) -> bool scalar-carrier
walk shape.
§Third representation kind on the presence-probe axis
The workspace-wide closed-set-driven presence-probe algebra spans
three underlying representation kinds; every downstream consumer
composes through the SAME has(kind: K) -> bool shape regardless
of the field’s Rust type:
- Option-slot (populated-slot semantics) —
crate::intent::Intent::hasandcrate::lifetime::Lifetime::has, both bodieskind.select(self).is_some()over a tagged-union parent whose discriminator’sselectprojects onto anOption<&V>. - Slice (walk-a-Vec semantics) —
crate::boundary::ConditionSliceExt::has_kindon&[Condition]andcrate::spec::DependsOnSliceExt::has_must_reachon&[DependsOn], both bodiesself.iter().any(|c| c.kind == kind)over a per-entry discriminator field. - Scalar (variant-equality semantics) — THIS primitive on
spec.signals.sighup_strategy, bodyself.sighup_strategy == kindover a non-Option, non-Vec closed-set-discriminator field.SighupStrategyis a#[derive(DeriveClosedSet)]implementor with aDefaultimpl, so the field is ALWAYS one of the ALL variants — there is no absent state to detect, and the probe answers “does the carrier’s variant equal this discriminator” rather than “is this slot populated”.
§Semantics — VARIANT match, not POPULATED slot
has_sighup_strategy(kind) returns true iff
self.sighup_strategy == kind. On a SignalPolicy::default
(sighup_strategy: SighupStrategy::default() = Reconverge) the
probe returns true for SighupStrategy::Reconverge and
false for every other variant — distinct from the Option-slot
axis where a default carrier returns false for EVERY kind. The
SighupStrategy::default arm’s answer is legitimate operator
signal: a Process that left :signals :sighupStrategy at the
substrate default IS configured for Reconverge, and a
:requires (sighup-Reconverge) should pass; only an operator who
deliberately overrode the strategy to Restart or Noop fails
the tag on this axis.
§Sibling to the presence-probe algebra
Same shape (has(kind)), same axis (closed-set discriminator on
a ProcessSpec field), same operator-facing answer (does this
spec carry this discriminator on this axis). A future
unification (a trait for closed-set-driven presence probes that
admits all three representation kinds — Option-slot,
slice, scalar) lands as ONE peer trait with every current
implementor picking up the trait default in lockstep.
§Compounding
A future closed-set-discriminator scalar field on ProcessSpec
(or any of its nested structs) that wants a
<prefix>-<kind> require-tag family — a
verification-phase-<kind> on spec.compliance.<binding>.phase,
a routing-form-<kind> on spec.routing.as_ref().map(|r| r.form), a future intent-kind scalar discriminator on any
scalar-enum spec field — lands as ONE peer inherent method with
the same one-line self.<field> == kind body and routes through
the same strip_and_classify_prefixed_kind::<K, _> shape in
tatara-check.
Theory anchor: THEORY.md §II.1 invariant 5 — composition
preserves proofs; the scalar-carrier presence-probe body lives at
ONE substrate site so every downstream
(sighup-<kind> require-tag family in tatara-check, closed-set
audit dispatchers, future variant additions on
SighupStrategy) binds through the SAME shape rather than
restating the signals.sighup_strategy == kind closure body at
each callsite. THEORY.md §VI.1 — generation over composition;
a future SighupStrategy variant (a Suspend that maps SIGHUP
onto crate::phase::ProcessPhase::Zombie via
SighupStrategy::sighup_target) lands at ONE ALL entry + ONE
as_str arm on the closed set and the probe picks it up
mechanically without further per-consumer edits.
Sourcepub fn has_sighup_target(&self, phase: ProcessPhase) -> bool
pub fn has_sighup_target(&self, phase: ProcessPhase) -> bool
Derived-Option-child presence probe on the SIGHUP-target
projection — true iff this policy’s stored
Self::sighup_strategy transitions this Process INTO
phase on SIGHUP reception (as read through
SighupStrategy::has_target, which composes
SighupStrategy::sighup_target with an
== Some(phase) gate).
The one-line collapse of the signals.sighup_strategy.sighup_target() == Some(phase) closure body lifted to ONE substrate owner past
the ★★ PRIME-DIRECTIVE ≥ 2 duplication threshold — the
sighup-target-<phase> require-tag prefix family in
[tatara-check]’s point-domain require-tag classifier is the
first workspace-wide consumer. Composes through
SighupStrategy::has_target so a regression in the
SighupStrategy::sighup_target projection surfaces at ONE
substrate site and every downstream (this method, the
require-tag classifier, closed-set audit dispatchers walking
crate::phase::ProcessPhase::ALL against SIGHUP transition
semantics) inherits the shift.
§Semantics — DERIVED sighup_target, not raw strategy equality
Sibling to Self::has_sighup_strategy on the SAME
Self::sighup_strategy field: has_sighup_strategy asks
“does this policy CARRY the queried strategy literal” (raw
stored-scalar equality); has_sighup_target asks “would this
policy TRANSITION the Process into the queried phase on
SIGHUP” (compound sighup_target projection). The two probes
coexist because a future
SighupStrategy variant that reuses an existing target
(a hypothetical Refresh mapping to Reconverging) would
satisfy has_sighup_target(Reconverging) alongside the
existing Reconverge-carrying policies — distinct stored
variants, same derived target — while
has_sighup_strategy(Reconverge) stays keyed strictly on
the stored variant.
§Sibling scalar-carrier probes
Self::has_sighup_strategy— required parent × defaulted scalar child (stored). SAME parent, SAME field, RAW discriminator equality.crate::routing::RoutingSpec::has_form— Option-parent × derived-scalar-child. Peer on the “derived child” axis, but the derived projection returns raw [RoutingForm] rather thanOption<RoutingForm>(there is noNone-projecting variant).- THIS — required-parent × derived-Option-child. First
occupant on the (required-parent × derived-Option-child)
corner of the presence-probe algebra: the child projection
returns
Option<K>because one variant (SighupStrategy::Noop) transitions into no phase at all, and theNonearm short-circuits every query tofalse.
§Compounding
The point-domain require-tag surface in
tatara-reconciler::bin::tatara-check composes this primitive
with the closed-set crate::phase::ProcessPhase’s
autoderived FromStr through the
strip_and_classify_prefixed_kind substrate to publish the
TWENTY-SIXTH closed-set-driven prefix family in the point-
domain classifier’s dispatch table
(sighup-target-<phase>), byte-for-byte symmetrical with the
sibling sighup-<kind> family that composes through
Self::has_sighup_strategy.
A future SighupStrategy variant reaches this probe
through ONE ALL entry + one as_str arm + one
sighup_target arm alone — no per-caller edit at this
composition, no per-consumer restatement of the
signals.sighup_strategy.sighup_target() == Some(phase) closure
body. A future crate::phase::ProcessPhase variant that a
hypothetical fresh strategy targets is reached by pairing a
new sighup_target arm with a new ALL entry — again ONE
substrate edit and every downstream inherits the shift.
Theory anchor: THEORY.md §II.1 invariant 5 — composition
preserves proofs; the derived-Option-child presence-probe
composition (self.sighup_strategy.has_target(phase)) lives
at ONE substrate site so every downstream
(sighup-target-<phase> require-tag family in tatara-check,
closed-set audit dispatchers, future variant additions on
either SighupStrategy or
crate::phase::ProcessPhase) binds through the SAME
has_sighup_target(phase) shape rather than restating the
signals.sighup_strategy.sighup_target() == Some(phase) chain at
each callsite. THEORY.md §VI.1 — generation over composition;
the SighupStrategy::sighup_target projection is the ONE
per-variant edit site every future strategy variant reaches
through, and this method inherits the shift automatically.
Trait Implementations§
Source§impl Clone for SignalPolicy
impl Clone for SignalPolicy
Source§fn clone(&self) -> SignalPolicy
fn clone(&self) -> SignalPolicy
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 SignalPolicy
impl Debug for SignalPolicy
Source§impl Default for SignalPolicy
impl Default for SignalPolicy
Source§impl<'de> Deserialize<'de> for SignalPolicy
impl<'de> Deserialize<'de> for SignalPolicy
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 SignalPolicy
impl JsonSchema for SignalPolicy
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 SignalPolicy
impl RefUnwindSafe for SignalPolicy
impl Send for SignalPolicy
impl Sync for SignalPolicy
impl Unpin for SignalPolicy
impl UnsafeUnpin for SignalPolicy
impl UnwindSafe for SignalPolicy
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);