pub struct LoadSession { /* private fields */ }Expand description
Kernel-backed loader session used by the command entry API.
Implementations§
Source§impl LoadSession
impl LoadSession
Sourcepub fn run_loaded_boot(&mut self, boot: &CliBoot) -> Result<i32, CliError>
pub fn run_loaded_boot(&mut self, boot: &CliBoot) -> Result<i32, CliError>
Loads a boot session and runs the selected loaded CLI entrypoint.
Sourcepub fn run_loaded_handoff(
&mut self,
envelope: &CliEnvelope,
) -> Result<i32, CliError>
pub fn run_loaded_handoff( &mut self, envelope: &CliEnvelope, ) -> Result<i32, CliError>
Runs the selected loaded CLI entrypoint for an already-loaded session.
Source§impl LoadSession
impl LoadSession
Sourcepub fn run_loaded_introspection(
&mut self,
boot: &CliBoot,
) -> Result<String, CliError>
pub fn run_loaded_introspection( &mut self, boot: &CliBoot, ) -> Result<String, CliError>
Loads a boot session and returns list/inspect output for loader metadata.
Listing or inspecting loaded libraries does not require a boot codec. When
the codec is unavailable, fall back to loading just the explicit --load
sources so they can still be introspected. (load_boot resolves the boot
codec first and returns before loading --load sources when that codec is
unavailable, so an empty receipt set means the codec was the failure.)
Source§impl LoadSession
impl LoadSession
Sourcepub fn add_loader(&mut self, loader: impl LibLoader + 'static)
pub fn add_loader(&mut self, loader: impl LibLoader + 'static)
Adds a kernel loader to the session.
Sourcepub fn add_catalog_source(
&mut self,
symbol: impl AsRef<str>,
source: CatalogSource,
)
pub fn add_catalog_source( &mut self, symbol: impl AsRef<str>, source: CatalogSource, )
Registers a catalog source for a library symbol.
Sourcepub fn with_catalog_source(
self,
symbol: impl AsRef<str>,
source: CatalogSource,
) -> Self
pub fn with_catalog_source( self, symbol: impl AsRef<str>, source: CatalogSource, ) -> Self
Registers a catalog source, builder-style.
Sourcepub fn with_loader(self, loader: impl LibLoader + 'static) -> Self
pub fn with_loader(self, loader: impl LibLoader + 'static) -> Self
Adds a kernel loader, builder-style.
Sourcepub fn add_host_factory(
&mut self,
name: impl Into<String>,
factory: impl Fn() -> Box<dyn Lib> + Send + Sync + 'static,
)
pub fn add_host_factory( &mut self, name: impl Into<String>, factory: impl Fn() -> Box<dyn Lib> + Send + Sync + 'static, )
Adds a host library factory to the static host catalog.
Sourcepub fn with_host_factory(
self,
name: impl Into<String>,
factory: impl Fn() -> Box<dyn Lib> + Send + Sync + 'static,
) -> Self
pub fn with_host_factory( self, name: impl Into<String>, factory: impl Fn() -> Box<dyn Lib> + Send + Sync + 'static, ) -> Self
Adds a host library factory, builder-style.
Sourcepub fn with_crates_io_resolver(self, resolver: CratesIoResolver) -> Self
pub fn with_crates_io_resolver(self, resolver: CratesIoResolver) -> Self
Replaces the crates.io resolver used for crates.io: sources.
Sourcepub fn with_context(self, configure: impl FnOnce(&mut Cx)) -> Self
pub fn with_context(self, configure: impl FnOnce(&mut Cx)) -> Self
Applies direct access to the session context, builder-style.
Hosts use this to install context-level runtime support while keeping concrete command behavior in loaded libraries.
Sourcepub fn with_capability(self, capability: CapabilityName) -> Self
pub fn with_capability(self, capability: CapabilityName) -> Self
Grants a capability to the session’s kernel context, builder-style.
Loaders that require a capability (for example the native dynamic-library
loader requires native_dynamic_load_capability()) only succeed when the
host has granted it. This lets a composed sim build authorize the
loaders it registers.
Sourcepub fn add_default_verb_sources(
&mut self,
verb: impl Into<String>,
sources: Vec<LibSourceSpec>,
)
pub fn add_default_verb_sources( &mut self, verb: impl Into<String>, sources: Vec<LibSourceSpec>, )
Registers sources used when verb is selected without explicit loads.
Sourcepub fn with_default_verb_sources(
self,
verb: impl Into<String>,
sources: Vec<LibSourceSpec>,
) -> Self
pub fn with_default_verb_sources( self, verb: impl Into<String>, sources: Vec<LibSourceSpec>, ) -> Self
Registers sources used when verb is selected without explicit loads,
builder-style.
Sourcepub fn receipts(&self) -> &[LoadReceipt]
pub fn receipts(&self) -> &[LoadReceipt]
Returns load receipts in boot order.
Sourcepub fn load_boot(&mut self, boot: &CliBoot) -> Result<&[LoadReceipt], CliError>
pub fn load_boot(&mut self, boot: &CliBoot) -> Result<&[LoadReceipt], CliError>
Loads every requested library in the parsed boot controls.
Sourcepub fn load_source(
&mut self,
source: &LibSourceSpec,
) -> Result<LoadReceipt, CliError>
pub fn load_source( &mut self, source: &LibSourceSpec, ) -> Result<LoadReceipt, CliError>
Loads one source through the kernel loader and records a receipt.
Sourcepub fn unload_receipt(
&mut self,
receipt: &LoadReceipt,
) -> Result<Vec<LibId>, CliError>
pub fn unload_receipt( &mut self, receipt: &LoadReceipt, ) -> Result<Vec<LibId>, CliError>
Unloads a receipt’s library through the kernel lifecycle path.