Skip to main content

sim_run_loaders/
lib.rs

1#![deny(unsafe_code)]
2#![deny(missing_docs)]
3//! Low-level loader plugins for the SIM bootloader.
4//!
5//! The crate owns loader mechanisms that the `sim` binary composes behind
6//! feature gates. It deliberately depends on kernel and codec contracts rather
7//! than the SDK umbrella.
8//!
9//! Native and wasm loaders both surface `site` exports as opaque registry
10//! values keyed by placement symbols. The kernel stores the value and export
11//! record; server and agent libraries give the value `EvalSite` behavior.
12
13#[cfg(feature = "codec-binary")]
14mod binary_pack;
15#[cfg(any(feature = "codec-binary", feature = "codec-lisp"))]
16mod expr;
17#[cfg(feature = "codec-lisp")]
18mod lisp_source;
19#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
20mod manifest;
21#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
22mod native;
23#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
24mod native_class;
25#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
26mod native_macro;
27#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
28mod native_number;
29#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
30mod native_site;
31mod reexport;
32#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
33mod shape;
34#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
35mod shared;
36mod source_kind;
37#[cfg(any(feature = "wasm", test))]
38mod wasm;
39
40#[cfg(feature = "codec-binary")]
41pub use binary_pack::{
42    BinaryLibPack, BinaryPackLoader, decode_binary_lib_pack, encode_binary_lib_pack,
43};
44#[cfg(feature = "codec-lisp")]
45pub use lisp_source::LispSourceLoader;
46#[cfg(all(feature = "codec-lisp", feature = "codec-binary"))]
47pub use lisp_source::{
48    compile_lisp_source_pack, compile_lisp_source_text_to_pack,
49    encode_lisp_source_text_to_binary_pack, export_lisp_source_file_to_binary_pack,
50};
51#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
52pub use native::{
53    NativeDylibLoader, NativeGuest, encode_native_manifest_response, validate_native_abi_header,
54};
55#[cfg(all(feature = "dynamic-native", not(target_arch = "wasm32")))]
56pub use native_macro::NativeAbiMacro;
57#[cfg(all(feature = "codec-lisp", feature = "shape"))]
58pub use reexport::SourceTemplateMacro;
59pub use reexport::{ReexportKind, ReexportSpec};
60pub use source_kind::{
61    BYTES_SOURCE_KIND, CONTENT_ADDRESS_SOURCE_KIND, PATH_SOURCE_KIND, URL_SOURCE_KIND,
62    bytes_from_payload, bytes_from_source, bytes_source, bytes_source_kind, bytes_source_spec,
63    catalog_bytes_source, catalog_content_address_source, catalog_path_source, catalog_url_source,
64    content_address_payload, content_address_source, content_address_source_kind,
65    content_address_source_spec, is_bytes_source, is_path_source, is_url_source, path_from_payload,
66    path_from_source, path_payload, path_source, path_source_kind, path_source_spec,
67    url_from_payload, url_from_source, url_source, url_source_kind, url_source_spec,
68};
69#[cfg(any(feature = "wasm", test))]
70pub use wasm::{WasmLoader, wasm_load_capability};