pub enum BreatheDimensionKind {
Memory,
Cpu,
Storage,
}Expand description
Closed-set typed identifier for the three reachable breathe Band CR
kinds a BreatheDimension::kind keyword can target — Self::Memory
→ MemoryBand, Self::Cpu → CpuBand, Self::Storage →
StorageBand — as a Rust enum, so the (keyword-set, CR-kind,
name-segment) triple binds at ONE site on the typed algebra rather
than at three byte-identical string-literal sites scattered across
EnvMatrixSpec::breathe_bands and the deleted band_kind_for
helper.
Pre-lift the dispatch lived as a string-input / &'static str-output
band_kind_for helper paired with an inline
dim.kind.to_ascii_lowercase() composing the band’s metadata-name
segment. The two arms of the pairing did NOT canonicalize together:
band_kind_for("mem") and band_kind_for("memory") both projected
to "MemoryBand", but the inline name-segment site echoed the
operator’s raw alias (<env>-mem vs <env>-memory), so a single
matrix sweep that wrote one dimension as "mem" and another as
"memory" produced two bands with drift-shaped names and no compile
or runtime signal that the names depended on operator-side alias
choice. Post-lift the pairing binds at ONE typed projection
(Self::band_kind + Self::name_segment) — both the CR kind
AND the name segment derive from the same closed-set variant, so
every alias canonicalizes to ONE band-name shape regardless of how
the operator spelled the dimension keyword.
Adding a fourth dimension (e.g. Network → NetworkBand,
name-segment "network") extends the enum AND the three projection
arms (Self::from_keyword, Self::band_kind,
Self::name_segment) 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 where the new band-kind projects but the name-segment
falls back to the raw keyword.
Sibling closed-set lift to this file’s MatrixTarget
(three-of-three magic-target identifier on the same EphemeralSpec
algebra) and 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 breathe-dimension CR-kind / name-segment
pairs on a typed marker identity.
Theory anchor: THEORY.md §V.1 — knowable platform; the closed set
of breathe-dimension keywords becomes a TYPE rather than three
&'static str literals at one site and a raw-keyword to_ascii_ lowercase() at another. A typo in any arm becomes a compile error
against the typed projection. THEORY.md §VI.1 — generation over
composition; the (keyword-set, CR-kind, name-segment) triple was
load-bearing across two sites yet enforced by per-site call-site
discipline — past the ≥2 PRIME-DIRECTIVE trigger once the
structural shape is named.
Variants§
Memory
memory / mem → MemoryBand, name-segment "memory".
Cpu
cpu → CpuBand, name-segment "cpu".
Storage
storage / disk → StorageBand, name-segment "storage".
Implementations§
Source§impl BreatheDimensionKind
impl BreatheDimensionKind
Sourcepub const ALL: [Self; 3]
pub const ALL: [Self; 3]
The closed set of breathe dimensions — single source of truth
that drives the Self::from_keyword decode sweep AND the
Self::name_segment projection through Self::aliases.
Adding a fourth dimension (e.g. Network → NetworkBand,
name-segment "network") lands at one ALL entry + one
aliases arm + one band_kind arm, exhaustively checked by
the compiler (the [Self; 3] array literal forces the arity)
AND by the per-variant truth-table tests below. Sibling
closed-set lift to every other ALL-keyed enum in this crate
including MatrixTarget::ALL (the file-local closed-set
peer), 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
breathe-dimension enumeration, and exhaustive bidirection
sweeps project through this constant rather than re-listing
the variants at every consumer.
Sourcepub fn aliases(self) -> &'static [&'static str]
pub fn aliases(self) -> &'static [&'static str]
The closed alias set this variant accepts at the
BreatheDimension::kind boundary (lowercase). Slot 0 IS the
canonical name segment — Self::name_segment reads
aliases()[0] so the canonical-name and alias-set pairing
binds at ONE site rather than at TWO sites (a from_keyword
alias-union arm AND a name_segment literal arm per variant).
Pre-lift the (alias-set, canonical-name) pairing was load-
bearing across two methods yet enforced by per-site call-site
discipline — a regression that renames the Self::Memory
canonical from "memory" → "ram" in Self::name_segment
without updating the Self::from_keyword arm silently
desynchronizes the two sites (band names track the canonical
but decode keeps accepting only "memory" / "mem"). Post-
lift the rename lands at ONE Self::aliases arm and
Self::name_segment + Self::from_keyword automatically
track because both project through this method.
Every alias is lowercase; callers MUST lowercase their input
before comparing (the Self::from_keyword sweep does this
once at the top of its loop). The slice MUST be non-empty —
name_segment() panics on empty; the
breathe_dimension_kind_aliases_nonempty_for_every_variant
truth-table test pins the contract.
Sourcepub fn from_keyword(kw: &str) -> Option<Self>
pub fn from_keyword(kw: &str) -> Option<Self>
Decode a BreatheDimension::kind keyword (case-insensitive)
into the typed marker, or None for keywords that aren’t in
the closed set (they fall through to the filter_map drop in
EnvMatrixSpec::breathe_bands — the dimension contributes
no band). Closed-set primary inverse of Self::band_kind
and Self::name_segment: every primary / alias keyword for
a variant decodes back to that variant. Lifted onto a linear
search across Self::ALL keyed on Self::aliases so the
canonical lowercase alias literals live at ONE site (the
aliases arms) rather than at TWO sites (a from_keyword
alias-union arm AND a name_segment literal arm per variant)
— adding a fourth dimension extends only ALL + aliases +
band_kind, NOT a third per-variant literal site.
Sourcepub fn band_kind(self) -> &'static str
pub fn band_kind(self) -> &'static str
Canonical breathe Band CR kind — the kind: field on the
emitted Band CR (MemoryBand / CpuBand / StorageBand).
Projects through &'static str (no allocation) so consumers
(the breathe_bands emitter, future CRD discovery, future
LSP completion lists) compose with the same shape
tatara_lisp’s QuoteForm::prefix / MatrixTarget::marker
closed-set surfaces use.
Sourcepub fn name_segment(self) -> &'static str
pub fn name_segment(self) -> &'static str
Canonical lower-case keyword used as the band metadata-name
segment ({env-name}-{name-segment}). Pinned to the variant
rather than echoed from the operator-side alias: a sweep that
declares (:kind "mem" …) produces <env>-memory, NOT
<env>-mem — every alias funnels to ONE deterministic band
name so two dimensions written with two different aliases
("mem" and "memory") cannot collide-by-shape into
indistinguishable band names; the typed projection is the
canonical-name boundary the substrate’s deterministic-output
posture relies on. Projects through Self::aliases slot 0
so the canonical name + accepted-alias set live at ONE source
of truth — a future variant adds ONE aliases arm and the
canonical name is automatically the first entry.
Trait Implementations§
Source§impl Clone for BreatheDimensionKind
impl Clone for BreatheDimensionKind
Source§fn clone(&self) -> BreatheDimensionKind
fn clone(&self) -> BreatheDimensionKind
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 BreatheDimensionKind
Source§impl Debug for BreatheDimensionKind
impl Debug for BreatheDimensionKind
impl Eq for BreatheDimensionKind
Source§impl PartialEq for BreatheDimensionKind
impl PartialEq for BreatheDimensionKind
impl StructuralPartialEq for BreatheDimensionKind
Auto Trait Implementations§
impl Freeze for BreatheDimensionKind
impl RefUnwindSafe for BreatheDimensionKind
impl Send for BreatheDimensionKind
impl Sync for BreatheDimensionKind
impl Unpin for BreatheDimensionKind
impl UnsafeUnpin for BreatheDimensionKind
impl UnwindSafe for BreatheDimensionKind
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);