Skip to main content

VmBuiltinDef

Type Alias VmBuiltinDef 

Source
pub type VmBuiltinDef = BuiltinDef<VmBuiltinHandler>;
Expand description

BuiltinDef specialized to the VM’s handler type.

Aliased Type§

pub struct VmBuiltinDef {
    pub sig: BuiltinSignature,
    pub aliases: &'static [&'static str],
    pub handler: VmBuiltinHandler,
    pub category: Option<&'static str>,
    pub doc: Option<&'static str>,
    pub parser_only: bool,
    pub runtime_only: bool,
}

Fields§

§sig: BuiltinSignature

Static signature consumed by the parser/typechecker.

§aliases: &'static [&'static str]

Additional names that share this impl + signature. Each alias gets its own BuiltinSignature entry at install time (with the same param/return types) so the typechecker accepts both.

§handler: VmBuiltinHandler

Runtime handler (sync fn, async fn, or None for parser-only builtins). Type is opaque to this crate.

§category: Option<&'static str>

Free-form category label used for metadata/observability.

§doc: Option<&'static str>

Human-readable doc, typically the leading /// block from the impl function. Surfaced to LSP hover and harn explain.

§parser_only: bool

Set to true for builtins that exist in the parser registry but have no runtime entry (len, split, … — see PARSER_ONLY_EXCEPTIONS in the alignment test). The registry skips runtime registration for these.

§runtime_only: bool

Set to true for compiler-synthesized runtime helpers (sigil prefix __, opcode keywords, enum constructors) that exist as VM builtins but should NOT show up in the parser signature table. The registry skips signature publishing for these.