pub enum MatrixTarget {
Version,
Profile,
ChartRef,
}Expand description
Closed-set typed identifier for the @-prefixed magic targets a
MatrixAxis::path can write into on the base EphemeralSpec — the
three reachable aplicacao-field write targets (Self::Version →
aplicacao.version, Self::Profile → aplicacao.profile,
Self::ChartRef → aplicacao.chart_ref) — as a Rust enum, so the
three-way (path-string, aplicacao-field) pairing binds at ONE site on
the typed algebra rather than at three byte-identical inline arms in
[apply_axis].
Pre-lift the magic-target dispatch lived as three arms in
[apply_axis], each opening its own val.as_str().to_string() → field = … skeleton paired with its own &'static str literal arm
label. The (path-literal, aplicacao-field) pairing was load-bearing
across three sites yet only enforced by call-site discipline — a
regression that swapped two assignment targets (e.g. routed
"@version" to chart_ref) type-checked but silently mis-applied
every operator’s matrix sweep. Post-lift the pairing binds at ONE
typed projection (Self::apply) the substrate’s invariant relies on:
rustc’s closed-set match across Self enforces that every variant
has exactly one apply arm and exactly one Self::marker arm, and
the bidirectional contract from_path(t.marker()) == Some(t) makes the
decode + canonical-marker round-trip a TYPE rather than three string
literals scattered across the file.
Adding a fourth magic-target (e.g. @release-name →
aplicacao.release_name, @target-namespace →
aplicacao.target_namespace) extends the enum AND the three
projection arms (Self::from_path, Self::marker, Self::apply)
in lockstep — rustc binds the extension through exhaustiveness over
the closed enum so a partial extension that forgets ONE projection
becomes a compile error rather than a runtime drift.
Sibling closed-set lift to tatara-lisp’s QuoteForm (four-of-four
homoiconic prefix-wrappers), UnquoteForm (two-of-four template-
marker subset), MacroDefHead (two-of-two macro-definition heads),
and CompilerSpecIoStage (disk-persistence surface) closed-set
algebras: those enums key their respective dispatch / projection
variants on a typed identity carried inside the variant; this enum
keys the three reachable matrix-axis aplicacao-field write targets
on a typed marker identity.
Theory anchor: THEORY.md §V.1 — knowable platform; the closed set of
@-prefixed magic targets becomes a TYPE rather than three
&'static str literals scattered across [apply_axis]. A typo in
any arm becomes a compile error against the typed projection.
THEORY.md §VI.1 — generation over composition; the (path-literal,
aplicacao-field) pairing appeared at three arms — past the ≥2
PRIME-DIRECTIVE trigger once the structural shape is named.
THEORY.md §II.1 invariant 1 — typed entry; the matrix-axis
path-string to typed-target decoding IS the typed-entry gate at the
MatrixAxis::path boundary, and naming the closed-set identity
lifts the gate from per-site literal discipline to ONE method
the substrate’s diagnostic promotions hang off of.
Variants§
Version
@version → aplicacao.version.
Profile
@profile → aplicacao.profile.
ChartRef
@chart-ref → aplicacao.chart_ref.
Implementations§
Source§impl MatrixTarget
impl MatrixTarget
Sourcepub const ALL: [Self; 3]
pub const ALL: [Self; 3]
The closed set of magic targets — single source of truth that
drives the marker / Display / from_path triad AND the
per-variant apply arm. Adding a fourth magic target (e.g.
@release-name → aplicacao.release_name, @target-namespace
→ aplicacao.target_namespace) lands at one ALL entry + one
marker arm + one apply arm, exhaustively checked by the
compiler (the [Self; 3] array literal forces the arity) AND
by the per-variant bidirection + apply truth-table tests
below. Sibling closed-set lift to every other ALL-keyed enum
in this crate including crate::phase::ProcessPhase::ALL,
crate::intent::IntentKind::ALL,
crate::signal::ProcessSignal::ALL,
crate::boundary::ConditionKind::ALL,
crate::lifetime::TeardownPolicy::ALL, and
crate::classification::SubstrateType::ALL; having ONE
enumeration site means future LSP-completion, tatara-check
magic-target enumeration, and exhaustive bidirection sweeps
project through this constant rather than re-listing the
variants at every consumer.
Sourcepub fn from_path(path: &str) -> Option<Self>
pub fn from_path(path: &str) -> Option<Self>
Decode a MatrixAxis::path string into the typed marker, or
None for paths that aren’t reserved @-prefixed magic targets
(they fall through to [overlay_at_path] semantics inside
[apply_axis]). Closed-set dual of Self::marker: for every
variant t, from_path(t.marker()) == Some(t). Lifted onto a
linear search across Self::ALL keyed on Self::marker so
the canonical @-prefixed string literals live at ONE site
(the marker arms) rather than at TWO sites (a from_path
arm AND a marker arm per variant) — adding a fourth magic
target extends only ALL + the marker arm + the apply
arm, NOT a third per-variant literal site.
Sourcepub fn marker(self) -> &'static str
pub fn marker(self) -> &'static str
Canonical &'static str marker — the @-prefixed path literal
each variant decodes from. Bidirectional dual of Self::from_path:
for every variant t, from_path(t.marker()) == Some(t). The
&'static str lifetime lets consumers (axis-path docstrings,
future tatara-check typed-target enumerators, future LSP
completion lists) project through this method without an
allocation, parallel to how tatara_lisp’s QuoteForm::prefix
/ UnquoteForm::marker / CompilerSpecIoStage::operation
project their closed-set surfaces.
Sourcepub fn apply(self, spec: &mut EphemeralSpec, val: &Value)
pub fn apply(self, spec: &mut EphemeralSpec, val: &Value)
Apply a string value into the targeted [AplicacaoIntent] field
on spec.aplicacao. Non-string values are silently ignored —
matching the pre-lift [apply_axis] posture (the magic-target
arms only acted when val.as_str() succeeded; non-string axis
values for a magic target are dropped, NOT routed to the
overlay). The (variant, field-assignment) pairing binds at ONE
match arm rather than three byte-identical sites — a regression
that drifts ONE arm’s field target (e.g. routes
Self::Version to chart_ref) becomes a compile error
against the typed projection.
Trait Implementations§
Source§impl Clone for MatrixTarget
impl Clone for MatrixTarget
Source§fn clone(&self) -> MatrixTarget
fn clone(&self) -> MatrixTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MatrixTarget
Source§impl Debug for MatrixTarget
impl Debug for MatrixTarget
Source§impl Display for MatrixTarget
impl Display for MatrixTarget
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Project the variant through Self::marker — the canonical
@-prefixed path literal each variant decodes from. Pinned by
matrix_target_display_matches_marker_for_every_variant so a
future Display impl can’t drift from the canonical marker (the
posture every sibling-closed-set Display in this crate carries,
e.g. crate::lifetime_clock::TerminateReason,
crate::classification::Arity).
impl Eq for MatrixTarget
Source§impl PartialEq for MatrixTarget
impl PartialEq for MatrixTarget
impl StructuralPartialEq for MatrixTarget
Auto Trait Implementations§
impl Freeze for MatrixTarget
impl RefUnwindSafe for MatrixTarget
impl Send for MatrixTarget
impl Sync for MatrixTarget
impl Unpin for MatrixTarget
impl UnsafeUnpin for MatrixTarget
impl UnwindSafe for MatrixTarget
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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);