pub struct EncapsulatesSpec {
pub kind: EncapsulationKind,
pub mode: EncapsulationMode,
}Expand description
How a Process wraps pre-existing in-cluster state.
Optional on ProcessSpec — None means the Process is greenfield
(Manage mode applied to nothing pre-existing). The render phase
branches on kind to decide whether to emit fresh resources or
reference/adopt running ones.
Fields§
§kind: EncapsulationKindWhat kind of pre-existing state.
mode: EncapsulationModeReconciler’s relationship to that state. Defaults to Manage
(the operational default when encapsulates is set without
an explicit mode).
Implementations§
Source§impl EncapsulatesSpec
impl EncapsulatesSpec
Sourcepub fn has_mode(&self, kind: EncapsulationMode) -> bool
pub fn has_mode(&self, kind: EncapsulationMode) -> bool
Closed-set-driven presence probe — does this EncapsulatesSpec
carry the given EncapsulationMode discriminator on its
Self::mode slot? The ONE substrate primitive that owns the
(EncapsulatesSpec, EncapsulationMode) -> bool scalar-carrier walk
shape.
§Second scalar-carrier peer on the presence-probe axis
Peer of crate::spec::SignalPolicy::has_sighup_strategy — both
probe a scalar closed-set-discriminator field on an inner
crate::crd::ProcessSpec struct via a one-line
self.<field> == kind body. Together they close the SCALAR-CARRIER
stratum of the workspace-wide closed-set-driven presence-probe
algebra (the workspace-wide algebra spans three underlying
representation kinds — Option-slot, slice, scalar — see the
crate::spec::SignalPolicy::has_sighup_strategy docstring for
the full-shape rundown; this method is the second scalar-carrier
instance).
§Semantics — VARIANT match, not POPULATED slot
has_mode(kind) returns true iff self.mode == kind. On an
EncapsulatesSpec whose mode slot is the substrate default
(EncapsulationMode::default = EncapsulationMode::Manage)
the probe returns true for EncapsulationMode::Manage and
false for every other variant — legitimate operator signal
symmetric to crate::signal::SighupStrategy::default. An
operator who opted encapsulates in (populating the parent
Option<EncapsulatesSpec>) but left :mode unset IS configured
for Manage, and a :requires (encapsulation-mode-Manage) check
should pass on that spec.
§Interaction with the parent Option gate
The parent Process.spec.encapsulates field is an
Option<EncapsulatesSpec> (greenfield Processes carry None);
downstream consumers gate this probe on the parent presence via
spec.encapsulates.as_ref().is_some_and(|e| e.has_mode(kind)).
A permanent Process with encapsulates: None returns false for
every kind — including the default Manage variant — because
the operator DECLINED the encapsulation surface entirely rather
than defaulting into it. Symmetric to the
resolved_ephemeral().is_some_and(…) gate the
export-when-<kind> / channel-<kind> / report-format-<kind> /
artifact-<kind> slice-level probes compose on the ephemeral
axis.
§Compounding
A future closed-set-discriminator scalar field on EncapsulatesSpec
(a hypothetical SubmodeKind selecting a sub-strategy inside the
Adopt/Manage modes; a HandoffPhase scalar selecting when the
reconciler swaps ownership) 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. A future
EncapsulationMode variant (a hypothetical Observe submode,
a Migrate for scripted mode transitions) reaches every
downstream through ONE ALL entry on the closed set with the
probe body untouched.
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 (encapsulation-mode-<kind>
require-tag family in tatara-check, closed-set audit
dispatchers, future variant additions on EncapsulationMode)
binds through the SAME shape rather than restating the
encapsulates.mode == kind closure body at each callsite.
THEORY.md §VI.1 — generation over composition; a future
EncapsulationMode variant 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.
Trait Implementations§
Source§impl Clone for EncapsulatesSpec
impl Clone for EncapsulatesSpec
Source§fn clone(&self) -> EncapsulatesSpec
fn clone(&self) -> EncapsulatesSpec
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 EncapsulatesSpec
impl Debug for EncapsulatesSpec
Source§impl<'de> Deserialize<'de> for EncapsulatesSpec
impl<'de> Deserialize<'de> for EncapsulatesSpec
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 EncapsulatesSpec
impl JsonSchema for EncapsulatesSpec
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 moreSource§impl Serialize for EncapsulatesSpec
impl Serialize for EncapsulatesSpec
Source§impl TataraDomain for EncapsulatesSpec
impl TataraDomain for EncapsulatesSpec
Source§fn compile_from_args(args: &[Sexp]) -> Result<Self>
fn compile_from_args(args: &[Sexp]) -> Result<Self>
Auto Trait Implementations§
impl Freeze for EncapsulatesSpec
impl RefUnwindSafe for EncapsulatesSpec
impl Send for EncapsulatesSpec
impl Sync for EncapsulatesSpec
impl Unpin for EncapsulatesSpec
impl UnsafeUnpin for EncapsulatesSpec
impl UnwindSafe for EncapsulatesSpec
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);