Skip to main content

LoadCx

Struct LoadCx 

Source
pub struct LoadCx { /* private fields */ }
Expand description

The context a Lib sees while loading.

It exposes the object Factory, read access to the Registry, fresh stable-id allocation, capability checks, and symbol resolution against already-loaded exports. The kernel supplies this surface; the library uses it to wire its behavior in.

Implementations§

Source§

impl LoadCx

Source

pub fn factory(&self) -> &dyn Factory

The object factory available during load.

Source

pub fn registry(&self) -> &Registry

Read access to the registry as loading proceeds.

Source

pub fn fresh_class_id(&mut self) -> ClassId

Reserves a fresh stable class id.

Source

pub fn fresh_function_id(&mut self) -> FunctionId

Reserves a fresh stable function id.

Source

pub fn fresh_macro_id(&mut self) -> MacroId

Reserves a fresh stable macro id.

Source

pub fn fresh_case_id(&mut self) -> CaseId

Reserves a fresh stable case id.

Source

pub fn fresh_shape_id(&mut self) -> ShapeId

Reserves a fresh stable shape id.

Source

pub fn fresh_codec_id(&mut self) -> CodecId

Reserves a fresh stable codec id.

Source

pub fn fresh_number_domain_id(&mut self) -> NumberDomainId

Reserves a fresh stable number-domain id.

Source

pub fn require(&self, capability: &CapabilityName) -> Result<()>

Checks that the given capability is granted, returning Error::CapabilityDenied otherwise.

Source

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

Resolves an already-registered class value by symbol.

Source

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

Resolves an already-registered function value by symbol.

Source

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

Resolves an already-registered macro value by symbol.

Source

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

Resolves an already-registered shape value by symbol.

Source

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

Resolves an already-registered codec value by symbol.

Source

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

Resolves an already-registered number-domain value by symbol.

Source

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

Resolves an already-registered plain value by symbol.

Auto Trait Implementations§

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.