#[non_exhaustive]pub enum CommandKind {
Builtin,
UserTool,
Special,
Dynamic,
External,
}Expand description
The category the kernel resolves a command name into.
Returned by Kernel::classify_command. The classification mirrors the
interpreter’s real resolution order (execute_command_depth), not the
validator’s warning heuristics — it answers “what will run”, which is what a
consent gate needs.
The safe direction of any imprecision is to over-report External: an
embedder gating external commands should never see something classified as
internal that in fact escapes to PATH.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Builtin
A built-in tool run in-process (e.g. cat, grep, jq).
UserTool
A user-defined function (fn name { … }) — shadows a builtin of the same
name, matching the interpreter’s user-tools-first resolution.
Special
An interpreter special-form handled directly, never resolved through the
registry or PATH: true, false, source, ..
Dynamic
The name can’t be resolved statically because it’s a variable or
command-substitution expansion ($cmd, $(pick)). The embedder must
treat it conservatively.
External
Not a builtin, user function, or special-form: kaish will look it up as a
.kai script or external binary on PATH. This is the bucket a consent
gate cares about.
Implementations§
Source§impl CommandKind
impl CommandKind
Sourcepub fn escapes_kernel(self) -> bool
pub fn escapes_kernel(self) -> bool
True when the name escapes the kernel to a PATH lookup (External) or
can’t be resolved statically (Dynamic) — the two cases an external-command
consent gate must scrutinize.
Trait Implementations§
Source§impl Clone for CommandKind
impl Clone for CommandKind
Source§fn clone(&self) -> CommandKind
fn clone(&self) -> CommandKind
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 CommandKind
Source§impl Debug for CommandKind
impl Debug for CommandKind
Source§impl<'de> Deserialize<'de> for CommandKind
impl<'de> Deserialize<'de> for CommandKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CommandKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CommandKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CommandKind
Source§impl PartialEq for CommandKind
impl PartialEq for CommandKind
Source§impl Serialize for CommandKind
impl Serialize for CommandKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CommandKind
Auto Trait Implementations§
impl Freeze for CommandKind
impl RefUnwindSafe for CommandKind
impl Send for CommandKind
impl Sync for CommandKind
impl Unpin for CommandKind
impl UnsafeUnpin for CommandKind
impl UnwindSafe for CommandKind
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.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<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> ⓘ
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.