Skip to main content

shape_runtime/stdlib/
mod.rs

1//! Standard library modules for the Shape runtime.
2//!
3//! Each submodule implements a `std::*` namespace accessible from Shape code.
4//! Modules follow the [`ModuleExports`](crate::module_exports::ModuleExports)
5//! pattern established by `stdlib_time.rs`.
6//!
7//! All I/O-capable modules are tagged with required capabilities in
8//! [`capability_tags`] and enforced at compile time via the permission system.
9
10pub mod archive;
11pub mod byte_utils;
12pub mod capability_tags;
13pub mod compress;
14pub mod crypto;
15pub mod csv_module;
16pub mod deterministic;
17pub mod env;
18pub mod file;
19pub mod helpers;
20pub mod http;
21pub mod json;
22pub mod msgpack_module;
23pub mod parallel;
24pub mod regex;
25pub mod runtime_policy;
26pub mod set_module;
27pub mod toml_module;
28pub mod unicode;
29pub mod virtual_fs;
30pub mod xml;
31pub mod yaml;
32
33/// Return all shipped native stdlib modules defined in `shape-runtime`.
34///
35/// This is the canonical registry — every `create_*_module()` in the stdlib,
36/// `stdlib_time`, and `stdlib_io` trees is called exactly once. VM-side
37/// modules (state, transport, remote) live in `shape-vm` and must be added
38/// separately by the VM.
39pub fn all_stdlib_modules() -> Vec<crate::module_exports::ModuleExports> {
40    vec![
41        regex::create_regex_module(),
42        http::create_http_module(),
43        crypto::create_crypto_module(),
44        env::create_env_module(),
45        json::create_json_module(),
46        toml_module::create_toml_module(),
47        yaml::create_yaml_module(),
48        xml::create_xml_module(),
49        compress::create_compress_module(),
50        archive::create_archive_module(),
51        parallel::create_parallel_module(),
52        unicode::create_unicode_module(),
53        csv_module::create_csv_module(),
54        msgpack_module::create_msgpack_module(),
55        set_module::create_set_module(),
56        file::create_file_module(),
57        crate::stdlib_time::create_time_module(),
58        crate::stdlib_io::create_io_module(),
59    ]
60}