pub enum Semantic {
Show 16 variants
Keyword,
Symbol,
KeywordArg,
String,
Number,
Literal,
Comment,
Accent,
Muted,
Error,
Warning,
Info,
Hint,
Added,
Removed,
Unchanged,
}Variants§
Keyword
Language keywords — defcaixa, defteia, let, lambda, etc.
Symbol
Non-keyword symbols — identifiers, function names, variant names.
KeywordArg
:keyword-positioned atoms.
String
"string literals".
Number
42, 3.14.
Literal
#t, #f, nil.
Comment
; comments.
Accent
Primary accent — useful for highlights, carets, focused tokens.
Muted
Dim text — metadata, line numbers, help text.
Error
Warning
Info
Hint
Added
Removed
Unchanged
Implementations§
Source§impl Semantic
impl Semantic
pub const fn is_keyword(&self) -> bool
pub const fn is_symbol(&self) -> bool
pub const fn is_keyword_arg(&self) -> bool
pub const fn is_string(&self) -> bool
pub const fn is_number(&self) -> bool
pub const fn is_literal(&self) -> bool
pub const fn is_comment(&self) -> bool
pub const fn is_accent(&self) -> bool
pub const fn is_muted(&self) -> bool
pub const fn is_error(&self) -> bool
pub const fn is_warning(&self) -> bool
pub const fn is_info(&self) -> bool
pub const fn is_hint(&self) -> bool
pub const fn is_added(&self) -> bool
pub const fn is_removed(&self) -> bool
pub const fn is_unchanged(&self) -> bool
Source§impl Semantic
impl Semantic
Sourcepub const ALL: &'static [Self]
pub const ALL: &'static [Self]
Every variant of Semantic in declaration order.
The single canonical arm-list every substrate consumer that has
to walk the closed 15-arm semantic-style partition (the two
theme overlays’ exhaustive-match resolver functions
blackmatter_dark_color / blackmatter_light_color in
crate::blackmatter, the future LSP-side per-Semantic
SemanticTokenType dispatch at
caixa-lsp/src/main.rs, a future
feira lint --list-styles operator-facing enumeration verb)
reads for. Peer of the sibling closed-set fieldless typed
enums’ ALL slices already carried by
[caixa_core::CaixaKind] /
[caixa_core::supervisor::RestartStrategy] /
[caixa_core::supervisor::RestartPolicy] /
[caixa_core::aplicacao::PlacementStrategy] /
[caixa_core::upgrade::UpgradeInstruction] /
caixa_lint::diagnostic::Severity /
caixa_lint::diagnostic::FixSafety /
caixa_arch::InvariantKind / caixa_arch::ArchVerdict /
caixa_provedor::FerriteRuntime closed-set typed-enum
discriminator axes.
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Canonical kebab-case discriminator scalar for this variant — the
single substrate-primitive &'static str projection every
downstream consumer of the closed 16-arm Semantic partition
(a future LSP-side per-Semantic SemanticTokenType name-mapping
dispatch at caixa-lsp/src/main.rs, a future
feira lint --list-styles operator-facing enumeration verb, a
future caixa.nvim per-Semantic highlight-group name resolver
that reaches for a stable kebab identifier per arm, a future
blackmatter-shell per-arm classname the terminal emitter
composes into a data-semantic="<kebab>" attribute) reaches
through. Kebab-case matches the peer
gen_platform::IsVariant-derived kebab discriminant convention
the sibling closed-set typed enums
([caixa_core::CaixaKind::as_str],
[caixa_core::supervisor::RestartStrategy::as_str],
[caixa_core::supervisor::RestartPolicy::as_str],
[caixa_core::aplicacao::PlacementStrategy::as_str],
[caixa_core::upgrade::UpgradeInstruction::as_str],
caixa_lint::diagnostic::Severity::as_str,
caixa_lint::diagnostic::FixSafety::as_str,
caixa_arch::InvariantKind::as_str,
caixa_arch::ArchVerdict::as_str,
caixa_provedor::FerriteRuntime::variant_slug) already emit
on their canonical &'static str projection axis.
The 16 arms return the kebab-case forms of their PascalCase
variant names (Keyword → "keyword", KeywordArg →
"keyword-arg", Unchanged → "unchanged", etc.), matching
the peer closed-set typed-enum canonical byte-string conventions.
Peer of the std::fmt::Display and AsRef<str> impls on
this enum, which both route through this accessor so
format!("{s}"), s.as_str(), and
<Semantic as AsRef<str>>::as_ref(&s) resolve to the same
per-arm byte-string.
Sourcepub fn from_wire(s: &str) -> Option<Self>
pub fn from_wire(s: &str) -> Option<Self>
Reverse projection on the Semantic closed 16-arm enum’s
canonical kebab-tag axis — parses a "keyword" / "symbol" /
"keyword-arg" / "string" / "number" / "literal" /
"comment" / "accent" / "muted" / "error" / "warning" /
"info" / "hint" / "added" / "removed" / "unchanged" wire
byte-string back to the typed enum, or returns None when s
lies outside the 16-arm accept-set Self::as_str emits. The
single &str → Self projection every future re-entry point on
the caixa-theme semantic-style axis dispatches through (a future
feira lint --list-styles operator-facing enumeration verb
hydrating a per-arm row from a stored kebab identifier back to
the typed enum before rendering, a future caixa-lsp-side
per-SemanticTokenType re-parse binding a prior
Self::as_str output back to the typed enum for
per-Semantic-highlight dispatch, a future caixa.nvim per-
Semantic highlight-group resolver re-loading a stored kebab
identifier back to the typed enum, a future blackmatter-shell
per-arm classname reverse-lookup binding a
data-semantic="<kebab>" DOM attribute back to the typed enum
for per-arm style dispatch, a tracing::field::Value::Str-arm
structured-log re-loader binding a prior emission’s
Self::as_str output back to the typed enum for cross-run
per-Semantic-paint-histogram diff) would have had to re-inline a
16-arm match s cascade that expressed no compile-time link back
to the substrate primitive.
Same closed-set-reverse-projection discipline the sibling
[caixa_core::CaixaKind::from_wire] (2aa6d23),
[caixa_core::CaixaDialeto::from_wire] (d0e65ea),
[caixa_core::supervisor::RestartStrategy::from_wire] (4eec29c),
[caixa_core::supervisor::RestartPolicy::from_wire] (dd32ccf),
[caixa_core::aplicacao::PlacementStrategy::from_wire] (18c7342),
[caixa_core::dep::DepList::from_wire] (45ee563),
[caixa_core::render::PathShapeViolation::from_wire] (aebd9c6),
caixa_arch::invariants::InvariantKind::from_wire (b9e4e61),
caixa_arch::report::ArchVerdict::from_wire (6afe564),
caixa_lint::diagnostic::Severity::from_wire (5afff0e), and
caixa_lint::diagnostic::FixSafety::from_wire (bd505a1) typed
enums carry on the peer wire-side str → Self axes — extends
the substrate-wide (as_str, from_wire) round-trip family onto
the caixa-theme closed-set fieldless typed-enum axis (the first
closed-set fieldless typed enum on caixa-theme to converge on
the reverse-projection discipline), matching the same two-way
str ↔ Self round-trip every sibling closed-set enum already
carries. Method-named from_wire (not from_str) to match the
peer shapes verbatim and side-step a
clippy::should_implement_trait lint that a plain from_str
name would otherwise trigger without paired
std::str::FromStr impl scaffolding this axis does not carry
today. Returns Option<Self> (rather than Result<Self, _>) to
match the peer shapes: the caller picks the diagnostic form
appropriate for its use site (a feira lint --list-styles CLI
arg-parse renders its own per-verb error message; a future
admission-webhook rejection body wraps the None outcome with
the accepted-set enumeration Semantic::ALL.iter().map(…) for
operator diagnostics).
Pinned load-bearing at the substrate-primitive level by
[tests::semantic_from_wire_accepts_every_as_str_output]
(round-trip witness against the peer Self::as_str axis) and
[tests::semantic_from_wire_rejects_unknown_byte_strings]
(rejection witness against silent accept-set widening).
Trait Implementations§
Source§impl AsRef<str> for Semantic
Substrate-canonical AsRef<str> projection on the caixa-theme
Semantic closed-set fieldless typed enum — routes through the
same Semantic::as_str pub const fn scalar accessor the paired
std::fmt::Display impl already reaches for.
impl AsRef<str> for Semantic
Substrate-canonical AsRef<str> projection on the caixa-theme
Semantic closed-set fieldless typed enum — routes through the
same Semantic::as_str pub const fn scalar accessor the paired
std::fmt::Display impl already reaches for.
Peer of the sibling AsRef<str> impls the substrate carries on
[caixa_core::CaixaKind], [caixa_core::CaixaVersion],
[caixa_core::CaixaDialeto], [caixa_core::dep::DepList],
[caixa_core::supervisor::RestartStrategy],
[caixa_core::supervisor::RestartPolicy],
[caixa_core::aplicacao::PlacementStrategy],
[caixa_core::aplicacao::RateLimitUnit],
caixa_lint::diagnostic::Severity,
caixa_arch::InvariantKind, caixa_arch::ArchVerdict,
caixa_provedor::FerriteRuntime — extends the substrate-wide
(as_str, AsRef<str>, Display) canonical-projection triple onto
the caixa-theme closed-set typed-enum axis, so a future consumer
bound through the trait-idiomatic .as_ref() (a
HashMap::get::<str>(sem.as_ref()) per-Semantic style-lookup, a
future caixa-lsp SemanticTokenType::new(sem.as_ref())
registration site, any impl AsRef<str>-bound generic function)
reaches the same kebab byte-string Semantic::as_str returns
rather than an open-coded .as_str() projection at every
wire-up.
impl Copy for Semantic
Source§impl<'de> Deserialize<'de> for Semantic
impl<'de> Deserialize<'de> for Semantic
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 Display for Semantic
std::fmt::Display routed through Semantic::as_str, so the
pretty-printed byte-string every consumer that formats the semantic
style as user-facing text lands on (a future feira lint --list-styles
operator-facing enumeration verb’s per-arm line, a future
caixa-lsp diagnostic-source line naming the offending semantic,
a future caixa.nvim per-Semantic highlight-group name emitter,
a tracing::field::display(&sem) structured-log recorder on the
paint-side emit path) reaches for the same lifted kebab-case
per-arm byte-string Semantic::as_str returns.
impl Display for Semantic
std::fmt::Display routed through Semantic::as_str, so the
pretty-printed byte-string every consumer that formats the semantic
style as user-facing text lands on (a future feira lint --list-styles
operator-facing enumeration verb’s per-arm line, a future
caixa-lsp diagnostic-source line naming the offending semantic,
a future caixa.nvim per-Semantic highlight-group name emitter,
a tracing::field::display(&sem) structured-log recorder on the
paint-side emit path) reaches for the same lifted kebab-case
per-arm byte-string Semantic::as_str returns.
Peer of the sibling std::fmt::Display impls on the closed-set
typed enums the substrate carries — [caixa_core::CaixaKind],
[caixa_core::supervisor::RestartStrategy],
[caixa_core::supervisor::RestartPolicy],
[caixa_core::aplicacao::PlacementStrategy],
[caixa_core::upgrade::UpgradeInstruction],
caixa_lint::diagnostic::Severity,
caixa_lint::diagnostic::FixSafety,
caixa_arch::InvariantKind, caixa_arch::ArchVerdict,
caixa_provedor::FerriteRuntime — extended to the second-to-last
un-lifted caixa-theme closed-set fieldless typed enum on the
substrate-wide (as_str, AsRef<str>, Display) canonical-projection
triple ratchet the prior lifts converged onto.
impl Eq for Semantic
impl StructuralPartialEq for Semantic
Source§impl TryFrom<&str> for Semantic
Trait-idiomatic reverse projection on the Semantic closed 16-arm
caixa-theme semantic-style axis — routes byte-for-byte through the
paired substrate-primitive Semantic::from_wire Option<Self>
accessor so every future consumer that binds a canonical semantic
tag through the standard-library .try_into() / TryFrom axis
(a future feira lint --semantic=<kebab> CLI arg-parse that
composes into let sem: Semantic = s.try_into()?, a future
caixa-lsp per-token re-parse hydrating a prior
Semantic::as_str output back to the typed enum for
SemanticTokenType dispatch, a future caixa.nvim per-highlight-
group re-loader binding a stored kebab byte-string back through the
typed enum, a generic <T: TryFrom<&str>>-bound theme-overlay
re-loader over any of the substrate’s closed-set typed enums)
reaches the same 16-arm accept-set the sibling
Semantic::from_wire resolver parses through and the sibling
Semantic::as_str emits, rather than an open-coded per-arm
match s { "keyword" => …, "symbol" => …, … _ => … } cascade whose
arm-set has no compile-time link back to the substrate primitive.
impl TryFrom<&str> for Semantic
Trait-idiomatic reverse projection on the Semantic closed 16-arm
caixa-theme semantic-style axis — routes byte-for-byte through the
paired substrate-primitive Semantic::from_wire Option<Self>
accessor so every future consumer that binds a canonical semantic
tag through the standard-library .try_into() / TryFrom axis
(a future feira lint --semantic=<kebab> CLI arg-parse that
composes into let sem: Semantic = s.try_into()?, a future
caixa-lsp per-token re-parse hydrating a prior
Semantic::as_str output back to the typed enum for
SemanticTokenType dispatch, a future caixa.nvim per-highlight-
group re-loader binding a stored kebab byte-string back through the
typed enum, a generic <T: TryFrom<&str>>-bound theme-overlay
re-loader over any of the substrate’s closed-set typed enums)
reaches the same 16-arm accept-set the sibling
Semantic::from_wire resolver parses through and the sibling
Semantic::as_str emits, rather than an open-coded per-arm
match s { "keyword" => …, "symbol" => …, … _ => … } cascade whose
arm-set has no compile-time link back to the substrate primitive.
Complements the pre-existing forward-projection triple
(std::fmt::Display, AsRef<str>, Semantic::as_str) with
the paired trait-idiomatic reverse-projection axis: Rust-side
newtype/typed-enum convention pairs AsRef<str> with either
std::str::FromStr or TryFrom<&str> on the same primitive so
a caller who can project out to a &str can also project in
from one. The TryFrom<&str> axis is deliberately chosen over
std::str::FromStr to sidestep the clippy::should_implement_trait
lint the sibling method-named Semantic::from_wire would trigger
under a FromStr impl (the same design tradeoff the peer
[caixa_core::CaixaKind] (3c83606),
[caixa_core::CaixaDialeto] (bf33136),
[caixa_core::aplicacao::PlacementStrategy] (6fd00cd),
[caixa_core::supervisor::RestartStrategy] (5b828ed),
[caixa_core::supervisor::RestartPolicy] (6fdd0d9),
[caixa_core::aplicacao::WitShape] (5472902),
[caixa_core::aplicacao::RateLimitUnit] (bf78400),
[caixa_core::render::PathShapeViolation] (e67e48a),
caixa_arch::invariants::InvariantKind (e21a857),
caixa_arch::report::ArchVerdict (0a4cc45),
caixa_lint::diagnostic::Severity (a7bf74c), and
caixa_lint::diagnostic::FixSafety (df86c94) blocks note) — this
impl closes the trait-idiomatic reverse axis without disturbing the
method-named from_wire shape every peer closed-set typed enum
already carries.
type Error = () matches the sibling Semantic::from_wire’s
Option<Self> return-shape’s deliberate deferral of error typing:
the caller picks the diagnostic form appropriate for its use site
(a future feira lint --semantic CLI arg-parse composes its own
per-verb “unknown semantic-style tag: Semantic::ALL, a future admission-webhook
rejection body wraps the Err(()) outcome with the accepted-set
enumeration for operator diagnostics, a Result::map_err at the
call site lifts the axis-error to a per-verb error type). Same
shape the peer sibling reverse-projection axes carry. The return-
shape uses fully-qualified <Self as TryFrom<&str>>::Error because
the associated-type name would otherwise collide with the
Self::Error variant on the same primitive (the identical
ambiguous-associated-item defect the sibling
impl TryFrom<&str> for Severity (a7bf74c) already threads around
under #[deny(future_incompatible)]).
The paired TryFrom<&str> impl reaches the same 16-arm accept-
set the Semantic::from_wire resolver dispatches through, so any
future arm addition (a Namespace tier between Self::Symbol
and Self::KeywordArg for the M4 tatara-lisp module system’s
qualified-name semantic-token dispatch, a Deleted tier for a
hard-delete-mark distinct from Self::Removed the future 3-way
diff surface grows — both trajectory items the sibling
Semantic::ALL doc block already names) grows the trait-
idiomatic axis by construction: one caixa-theme edit on
Semantic::from_wire extends both the method-named reverse
projection every existing consumer keys off and the trait-
idiomatic reverse projection this impl exposes, without a
coordinated rewrite across every future TryFrom<&str>-bound
consumer’s arm-set.
Extends the substrate-wide closed-set-enum trait-idiomatic
reverse-projection family ([caixa_core::CaixaKind] via 3c83606,
[caixa_core::CaixaDialeto] via bf33136,
[caixa_core::aplicacao::PlacementStrategy] via 6fd00cd,
[caixa_core::supervisor::RestartStrategy] via 5b828ed,
[caixa_core::supervisor::RestartPolicy] via 6fdd0d9,
[caixa_core::aplicacao::WitShape] via 5472902,
[caixa_core::aplicacao::RateLimitUnit] via bf78400,
[caixa_core::render::PathShapeViolation] via e67e48a,
caixa_arch::invariants::InvariantKind via e21a857,
caixa_arch::report::ArchVerdict via 0a4cc45,
caixa_lint::diagnostic::Severity via a7bf74c, and
caixa_lint::diagnostic::FixSafety via df86c94) onto the first
closed-set fieldless typed enum on the caixa-theme surface — the
semantic-style 16-arm accept-set every per-Semantic paint dispatch,
every future caixa-lsp per-SemanticTokenType wire-up, and every
future caixa.nvim per-highlight-group re-loader keys off. The
thirteenth peer on the substrate surface, and the first inside
caixa-theme; with caixa_provedor::FerriteRuntime remaining as
the only outside-caixa-core closed-set fieldless typed enum whose
trait-idiomatic axis is still open.
Pinned load-bearing by
[tests::semantic_try_from_str_routes_through_from_wire_accessor]
(byte-parity pin against Semantic::from_wire across the 16-arm
accept-set) and
[tests::semantic_try_from_str_rejects_unknown_byte_strings]
(rejection witness against silent accept-set widening).
Auto Trait Implementations§
impl Freeze for Semantic
impl RefUnwindSafe for Semantic
impl Send for Semantic
impl Sync for Semantic
impl Unpin for Semantic
impl UnsafeUnpin for Semantic
impl UnwindSafe for Semantic
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
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<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.