pub struct Linker<'a> { /* private fields */ }Expand description
The handle a Lib uses to register its exports.
A Linker borrows the transaction’s registry and pending buffer, reserving
stable ids and staging class/function/macro/shape/codec/number-domain/value
exports plus number-domain operators. The kernel defines these registration
contracts; the library calls them to declare its behavior.
Implementations§
Source§impl<'a> Linker<'a>
impl<'a> Linker<'a>
Sourcepub fn class(&mut self, symbol: Symbol) -> Result<ClassId>
pub fn class(&mut self, symbol: Symbol) -> Result<ClassId>
Stages a class export under symbol, reserving a fresh class id.
Sourcepub fn class_with_id(&mut self, symbol: Symbol, id: ClassId) -> Result<ClassId>
pub fn class_with_id(&mut self, symbol: Symbol, id: ClassId) -> Result<ClassId>
Stages a class export under symbol using a caller-chosen class id,
reserving the id sequence up to it.
Sourcepub fn class_value(&mut self, symbol: Symbol, value: Value) -> Result<ClassId>
pub fn class_value(&mut self, symbol: Symbol, value: Value) -> Result<ClassId>
Stages a class export and binds its runtime value in one step.
Sourcepub fn bind_class_value(&mut self, id: ClassId, value: Value) -> Result<()>
pub fn bind_class_value(&mut self, id: ClassId, value: Value) -> Result<()>
Binds a runtime value to an already-staged class id.
Sourcepub fn function(&mut self, symbol: Symbol) -> Result<FunctionId>
pub fn function(&mut self, symbol: Symbol) -> Result<FunctionId>
Stages a function export under symbol, reserving a fresh function id.
Sourcepub fn function_value(
&mut self,
symbol: Symbol,
value: Value,
) -> Result<FunctionId>
pub fn function_value( &mut self, symbol: Symbol, value: Value, ) -> Result<FunctionId>
Stages a function export and binds its runtime value in one step.
Sourcepub fn bind_function_value(
&mut self,
id: FunctionId,
value: Value,
) -> Result<()>
pub fn bind_function_value( &mut self, id: FunctionId, value: Value, ) -> Result<()>
Binds a runtime value to an already-staged function id.
Sourcepub fn macro_export(&mut self, symbol: Symbol) -> Result<MacroId>
pub fn macro_export(&mut self, symbol: Symbol) -> Result<MacroId>
Stages a macro export under symbol, reserving a fresh macro id.
Sourcepub fn macro_value(&mut self, symbol: Symbol, value: Value) -> Result<MacroId>
pub fn macro_value(&mut self, symbol: Symbol, value: Value) -> Result<MacroId>
Stages a macro export and binds its runtime value in one step.
Sourcepub fn shape(&mut self, symbol: Symbol) -> Result<ShapeId>
pub fn shape(&mut self, symbol: Symbol) -> Result<ShapeId>
Stages a shape export under symbol, reserving a fresh shape id.
Sourcepub fn shape_value(&mut self, symbol: Symbol, value: Value) -> Result<ShapeId>
pub fn shape_value(&mut self, symbol: Symbol, value: Value) -> Result<ShapeId>
Stages a shape export and binds its runtime value in one step.
Sourcepub fn codec(&mut self, symbol: Symbol) -> Result<CodecId>
pub fn codec(&mut self, symbol: Symbol) -> Result<CodecId>
Stages a codec export under symbol, reserving a fresh codec id.
Sourcepub fn codec_value(&mut self, symbol: Symbol, value: Value) -> Result<CodecId>
pub fn codec_value(&mut self, symbol: Symbol, value: Value) -> Result<CodecId>
Stages a codec export and binds its runtime value in one step.
Sourcepub fn number_domain(&mut self, symbol: Symbol) -> Result<NumberDomainId>
pub fn number_domain(&mut self, symbol: Symbol) -> Result<NumberDomainId>
Stages a number-domain export under symbol, reserving a fresh id.
Sourcepub fn number_domain_value(
&mut self,
symbol: Symbol,
value: Value,
) -> Result<NumberDomainId>
pub fn number_domain_value( &mut self, symbol: Symbol, value: Value, ) -> Result<NumberDomainId>
Stages a number-domain export and binds its runtime value in one step.
Sourcepub fn site_value(&mut self, symbol: Symbol, value: Value) -> Result<RuntimeId>
pub fn site_value(&mut self, symbol: Symbol, value: Value) -> Result<RuntimeId>
Stages an opaque site export and binds its runtime value in one step.
The registry stores the value under the export symbol; concrete
EvalSite behavior belongs to libraries that query the site registry.
Sourcepub fn value_export(&mut self, symbol: Symbol) -> Result<()>
pub fn value_export(&mut self, symbol: Symbol) -> Result<()>
Stages a plain value export declaration (without binding a value).
Sourcepub fn declare_export(&mut self, kind: ExportKind, symbol: Symbol) -> Result<()>
pub fn declare_export(&mut self, kind: ExportKind, symbol: Symbol) -> Result<()>
Stages a Declared export record of any kind.
Sourcepub fn unsupported_export(
&mut self,
kind: ExportKind,
symbol: Symbol,
reason: impl Into<String>,
) -> Result<()>
pub fn unsupported_export( &mut self, kind: ExportKind, symbol: Symbol, reason: impl Into<String>, ) -> Result<()>
Stages an Unsupported export record with a
reason.
Sourcepub fn value(&mut self, symbol: Symbol, value: Value) -> Result<()>
pub fn value(&mut self, symbol: Symbol, value: Value) -> Result<()>
Stages a plain value export and binds its value in one step.
Sourcepub fn number_binary_op(&mut self, op: NumberBinaryOp)
pub fn number_binary_op(&mut self, op: NumberBinaryOp)
Stages a typed number binary operator.
Sourcepub fn value_number_binary_op(&mut self, op: ValueNumberBinaryOp)
pub fn value_number_binary_op(&mut self, op: ValueNumberBinaryOp)
Stages a value-level number binary operator.
Sourcepub fn number_unary_op(&mut self, op: NumberUnaryOp)
pub fn number_unary_op(&mut self, op: NumberUnaryOp)
Stages a typed number unary operator.
Sourcepub fn value_number_unary_op(&mut self, op: ValueNumberUnaryOp)
pub fn value_number_unary_op(&mut self, op: ValueNumberUnaryOp)
Stages a value-level number unary operator.
Sourcepub fn number_reduction_op(&mut self, op: NumberReductionOp)
pub fn number_reduction_op(&mut self, op: NumberReductionOp)
Stages a typed number reduction operator.
Sourcepub fn value_number_reduction_op(&mut self, op: ValueNumberReductionOp)
pub fn value_number_reduction_op(&mut self, op: ValueNumberReductionOp)
Stages a value-level number reduction operator.
Sourcepub fn promotion_rule(&mut self, rule: PromotionRule)
pub fn promotion_rule(&mut self, rule: PromotionRule)
Stages a typed number-domain promotion rule.
Sourcepub fn value_promotion_rule(&mut self, rule: ValuePromotionRule)
pub fn value_promotion_rule(&mut self, rule: ValuePromotionRule)
Stages a value-level number-domain promotion rule.