cosmwasm_vm/
lib.rs

1//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
2//! This crate provides VM bindings to run CosmWasm contracts.
3//!
4//! For more information, see: <https://cosmwasm.cosmos.network>
5
6mod backend;
7mod cache;
8mod calls;
9mod capabilities;
10mod compatibility;
11mod config;
12mod conversion;
13mod environment;
14mod errors;
15mod filesystem;
16mod imports;
17mod instance;
18mod limited;
19mod memory;
20mod modules;
21mod parsed_wasm;
22mod sections;
23mod serde;
24mod size;
25mod static_analysis;
26pub mod testing;
27mod wasm_backend;
28
29pub use crate::backend::{
30    Backend, BackendApi, BackendError, BackendResult, GasInfo, Querier, Storage,
31};
32pub use crate::cache::{AnalysisReport, Cache, Metrics, PerModuleMetrics, PinnedMetrics, Stats};
33pub use crate::calls::{
34    call_execute, call_execute_raw, call_ibc_destination_callback,
35    call_ibc_destination_callback_raw, call_ibc_source_callback, call_ibc_source_callback_raw,
36    call_instantiate, call_instantiate_raw, call_migrate, call_migrate_raw, call_migrate_with_info,
37    call_migrate_with_info_raw, call_query, call_query_raw, call_reply, call_reply_raw, call_sudo,
38    call_sudo_raw,
39};
40#[cfg(feature = "ibc2")]
41pub use crate::calls::{
42    call_ibc2_packet_ack, call_ibc2_packet_ack_raw, call_ibc2_packet_receive,
43    call_ibc2_packet_receive_raw, call_ibc2_packet_send, call_ibc2_packet_send_raw,
44    call_ibc2_packet_timeout, call_ibc2_packet_timeout_raw,
45};
46#[cfg(feature = "stargate")]
47pub use crate::calls::{
48    call_ibc_channel_close, call_ibc_channel_close_raw, call_ibc_channel_connect,
49    call_ibc_channel_connect_raw, call_ibc_channel_open, call_ibc_channel_open_raw,
50    call_ibc_packet_ack, call_ibc_packet_ack_raw, call_ibc_packet_receive,
51    call_ibc_packet_receive_raw, call_ibc_packet_timeout, call_ibc_packet_timeout_raw,
52};
53pub use crate::capabilities::capabilities_from_csv;
54pub use crate::config::{CacheOptions, Config, WasmLimits};
55pub use crate::errors::{
56    CommunicationError, CommunicationResult, RegionValidationError, RegionValidationResult,
57    VmError, VmResult,
58};
59pub use crate::instance::{DebugInfo, GasReport, Instance, InstanceOptions};
60pub use crate::serde::{from_slice, to_vec};
61pub use crate::size::Size;
62
63pub mod internals {
64    #![doc(hidden)]
65    //! We use the internals module for exporting types that are only
66    //! intended to be used in internal crates / utils.
67    //! Please don't use any of these types directly, as
68    //! they might change frequently or be removed in the future.
69
70    pub use crate::compatibility::{check_wasm, LogOutput, Logger};
71    pub use crate::instance::instance_from_module;
72    pub use crate::wasm_backend::{compile, make_compiling_engine, make_runtime_engine};
73}