Skip to main content

Linker

Struct Linker 

Source
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>

Source

pub fn lib_id(&self) -> LibId

The id of the library being loaded.

Source

pub fn registry(&self) -> &Registry

Read access to the transaction’s working registry.

Source

pub fn class(&mut self, symbol: Symbol) -> Result<ClassId>

Stages a class export under symbol, reserving a fresh class id.

Source

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.

Source

pub fn class_value(&mut self, symbol: Symbol, value: Value) -> Result<ClassId>

Stages a class export and binds its runtime value in one step.

Source

pub fn bind_class_value(&mut self, id: ClassId, value: Value) -> Result<()>

Binds a runtime value to an already-staged class id.

Source

pub fn function(&mut self, symbol: Symbol) -> Result<FunctionId>

Stages a function export under symbol, reserving a fresh function id.

Source

pub fn function_value( &mut self, symbol: Symbol, value: Value, ) -> Result<FunctionId>

Stages a function export and binds its runtime value in one step.

Source

pub fn bind_function_value( &mut self, id: FunctionId, value: Value, ) -> Result<()>

Binds a runtime value to an already-staged function id.

Source

pub fn macro_export(&mut self, symbol: Symbol) -> Result<MacroId>

Stages a macro export under symbol, reserving a fresh macro id.

Source

pub fn macro_value(&mut self, symbol: Symbol, value: Value) -> Result<MacroId>

Stages a macro export and binds its runtime value in one step.

Source

pub fn shape(&mut self, symbol: Symbol) -> Result<ShapeId>

Stages a shape export under symbol, reserving a fresh shape id.

Source

pub fn shape_value(&mut self, symbol: Symbol, value: Value) -> Result<ShapeId>

Stages a shape export and binds its runtime value in one step.

Source

pub fn codec(&mut self, symbol: Symbol) -> Result<CodecId>

Stages a codec export under symbol, reserving a fresh codec id.

Source

pub fn codec_value(&mut self, symbol: Symbol, value: Value) -> Result<CodecId>

Stages a codec export and binds its runtime value in one step.

Source

pub fn number_domain(&mut self, symbol: Symbol) -> Result<NumberDomainId>

Stages a number-domain export under symbol, reserving a fresh id.

Source

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.

Source

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.

Source

pub fn value_export(&mut self, symbol: Symbol) -> Result<()>

Stages a plain value export declaration (without binding a value).

Source

pub fn declare_export(&mut self, kind: ExportKind, symbol: Symbol) -> Result<()>

Stages a Declared export record of any kind.

Source

pub fn unsupported_export( &mut self, kind: ExportKind, symbol: Symbol, reason: impl Into<String>, ) -> Result<()>

Stages an Unsupported export record with a reason.

Source

pub fn value(&mut self, symbol: Symbol, value: Value) -> Result<()>

Stages a plain value export and binds its value in one step.

Source

pub fn number_binary_op(&mut self, op: NumberBinaryOp)

Stages a typed number binary operator.

Source

pub fn value_number_binary_op(&mut self, op: ValueNumberBinaryOp)

Stages a value-level number binary operator.

Source

pub fn number_unary_op(&mut self, op: NumberUnaryOp)

Stages a typed number unary operator.

Source

pub fn value_number_unary_op(&mut self, op: ValueNumberUnaryOp)

Stages a value-level number unary operator.

Source

pub fn number_reduction_op(&mut self, op: NumberReductionOp)

Stages a typed number reduction operator.

Source

pub fn value_number_reduction_op(&mut self, op: ValueNumberReductionOp)

Stages a value-level number reduction operator.

Source

pub fn promotion_rule(&mut self, rule: PromotionRule)

Stages a typed number-domain promotion rule.

Source

pub fn value_promotion_rule(&mut self, rule: ValuePromotionRule)

Stages a value-level number-domain promotion rule.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Linker<'a>

§

impl<'a> !UnwindSafe for Linker<'a>

§

impl<'a> Freeze for Linker<'a>

§

impl<'a> Send for Linker<'a>

§

impl<'a> Sync for Linker<'a>

§

impl<'a> Unpin for Linker<'a>

§

impl<'a> UnsafeUnpin for Linker<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.