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).
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