soroban_env_host_zephyr/
lib.rs

1//! This crate mainly exists to provide the Soroban [Host] type, which is the
2//! _implementation_ of the [Env] interface between guest contract code and the
3//! host it runs within.
4//!
5//! This crate also re-exports all of the content of the [soroban_env_common]
6//! crate for use by host (or contract local-testing) code. Most of the type and
7//! module definitions visible here are actually defined in the common crate.
8//!
9//! When unit-testing contracts natively (not using wasm), developers may also
10//! wish to enable the `"testutils"` feature, which enables an interface on
11//! [Host] for registering other test contracts by ID.
12//!
13//! The [Host] type provides some facilities above and beyond just the [Env]
14//! trait, including:
15//!
16//!   - The [budget] module which is responsible for measuring and limiting
17//!     execution costs in terms of CPU and memory.
18//!   - The [storage] module which is responsible for providing an interface
19//!     between contracts and their durable storage.
20//!
21#![recursion_limit = "256"]
22
23#[macro_use]
24mod macros;
25
26pub mod budget;
27pub mod events;
28pub use events::diagnostic::DiagnosticLevel;
29mod host;
30pub(crate) mod host_object;
31
32mod builtin_contracts;
33
34pub mod auth;
35pub mod vm;
36pub use vm::Vm;
37pub mod storage;
38pub use budget::{DEFAULT_HOST_DEPTH_LIMIT, DEFAULT_XDR_RW_LIMITS};
39pub use host::{
40    metered_map::MeteredOrdMap, metered_vector::MeteredVector, Host, HostError, Seed, SEED_BYTES,
41};
42pub use soroban_env_common::*;
43
44pub use wasmi;
45
46pub mod ledger_info;
47pub use ledger_info::LedgerInfo;
48
49pub mod e2e_invoke;
50pub mod fees;
51
52#[doc(hidden)]
53pub use host::{TraceEvent, TraceHook, TraceRecord, TraceState};
54
55#[cfg(feature = "bench")]
56#[doc(hidden)]
57pub mod cost_runner;
58
59#[cfg(any(test, feature = "testutils"))]
60pub use host::{ContractFunctionSet, ContractInvocationEvent};
61
62#[cfg(any(test, feature = "testutils"))]
63#[doc(hidden)]
64pub mod testutils;
65
66#[cfg(any(test, feature = "testutils"))]
67#[doc(hidden)]
68pub mod e2e_testutils;
69#[cfg(test)]
70mod test;