pub enum ReasonClass {
Reflect,
Dispatch,
Indirect,
Native,
Unresolved,
Setup,
}Expand description
The NORMATIVE projection of a raw unknown_why reason onto a fixed, cross-engine reason CLASS
(candor-spec REASON-SCOPED-UNKNOWN-DESIGN.md §1). Reason-scoped policies (deny E Unknown[class])
quantify over these classes, so the mapping MUST be identical in every engine — this mirrors the
java reference ReasonClass (its classify(String) path, since rust emits raw string reasons). The
class set is CLOSED (six members); a raw reason matching no pinned prefix maps to Unresolved —
conservative: it stays in scope of any Unknown[*] / Unknown[dynamic] policy, never silently
tolerated.
Variants§
Reflect
reflection / metaprogramming
Dispatch
unresolved virtual/dynamic dispatch, same-name ambiguity, invokedynamic
Indirect
callback / closure / function-value / async-continuation indirection
Native
FFI / native boundary
Unresolved
generic unresolvable call/import, AND the catch-all for any unrecognized raw reason
Setup
analysis not wired up (fixable, not a real dynamic hole): missing-config / no-tsconfig
Implementations§
Source§impl ReasonClass
impl ReasonClass
Sourcepub fn token(self) -> &'static str
pub fn token(self) -> &'static str
The lowercase policy-facing token (deny E Unknown[<token>]).
Sourcepub fn from_token(t: &str) -> Option<ReasonClass>
pub fn from_token(t: &str) -> Option<ReasonClass>
Parse a policy-facing token back to a class; None if it names no class.
Sourcepub fn classify(why: &str) -> ReasonClass
pub fn classify(why: &str) -> ReasonClass
Map a raw unknown_why reason to its normative class — prefix-based (raw reasons carry a
kind:detail shape, e.g. dispatch:foo::Bar), unrecognized → Unresolved. Byte-identical
intent to the java ReasonClass.classify(String).
⟨0.24⟩ THIS IS THE ONLY PLACE THIS ENGINE HOLDS SPEC §4’s KIND VOCABULARY. Every other reference
to a kind is either a raw string being emitted or the dispatch: prefix test in candor-query’s
dispatch frontier; there is no typed kind enum here. §4’s “AN ENGINE HOLDS THIS VOCABULARY TWICE,
AND THE HALVES DRIFT” paragraph records the JVM engine classifying ambiguous correctly HERE
while its typed Kind enum lacked the kind entirely — one token, two answers, inside one engine,
concealed precisely because this half was right. Holding it once is why that is not reachable in
this engine; a future typed representation must be added at the same commit as its control
(off_vocabulary_kinds_round_trip_and_classify_through_the_catch_all).
The five §4 kinds are reflect/native/dispatch/callback/ambiguous. ambiguous maps to
dispatch and rust is its only PRODUCER; indy/task-handoff are candor-java’s migration kinds
and dep:/dep-stale: are swift’s registered per-dependency-ENTRY kinds, reaching Unresolved
through the catch-all, which is the class §6.2 prescribes for them.
Sourcepub fn dynamic_set() -> BTreeSet<ReasonClass>
pub fn dynamic_set() -> BTreeSet<ReasonClass>
The dynamic alias — every GENUINE blind-spot class (excludes setup), incl. unresolved (the
catch-all) so Unknown[dynamic] never under-gates. The design’s recommended usable strict gate.
Trait Implementations§
Source§impl Clone for ReasonClass
impl Clone for ReasonClass
Source§fn clone(&self) -> ReasonClass
fn clone(&self) -> ReasonClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more