Skip to main content

LoaderRegistry

Struct LoaderRegistry 

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

A registry of LibLoaders plus catalog-resolvable library sources.

Implementations§

Source§

impl LoaderRegistry

Source

pub fn new() -> Self

Creates an empty loader registry.

Source

pub fn with_loader(self, loader: impl LibLoader + 'static) -> Self

Adds a loader, builder-style.

Source

pub fn add_loader(&mut self, loader: impl LibLoader + 'static)

Adds a loader.

Source

pub fn with_source(self, symbol: Symbol, source: CatalogSource) -> Self

Registers a catalog source for a library symbol, builder-style.

Source

pub fn add_source(&mut self, symbol: Symbol, source: CatalogSource)

Registers a catalog source for a library symbol.

Source

pub fn load_lib(&self, cx: &mut Cx, source: LibSource) -> Result<Box<dyn Lib>>

Loads a library, resolving catalog symbols and dispatching to the first accepting loader.

Source

pub fn load_and_register(&self, cx: &mut Cx, source: LibSource) -> Result<LibId>

Loads a library and registers it into the registry, returning its id.

Source

pub fn resolve_source_spec(&self, source: &LibSourceSpec) -> LibSourceSpec

Resolves a data-only source spec through this registry’s catalog.

Source

pub fn load_and_register_with_receipt( &self, cx: &mut Cx, source: LibSourceSpec, ) -> Result<LibBootReceipt>

Loads a data-only source and returns the boot receipt for the committed library.

Source

pub fn replay_boot_receipts( &self, cx: &mut Cx, receipts: &[LibBootReceipt], ) -> Result<Vec<LibBootReceipt>>

Replays load-order boot receipts, verifying that each replayed library produces the same receipt data.

Source

pub fn replay_boot_state( &self, cx: &mut Cx, state: &RegistryBootState, ) -> Result<Vec<LibBootReceipt>>

Replays a registry boot state and returns the receipts produced by the replay.

Source

pub fn inspect_manifest( &self, cx: &mut Cx, source: LibSource, ) -> Result<LibManifest>

Inspects a source’s manifest without loading it, resolving catalog symbols first.

Trait Implementations§

Source§

impl Default for LoaderRegistry

Source§

fn default() -> LoaderRegistry

Returns the “default value” for a type. Read more

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.