xref: /wasmtime-44.0.1/crates/environ/src/lib.rs (revision bda02c19)
1 //! Internal dependency of the `wasmtime` crate.
2 //!
3 //! This crate is responsible for defining types and basic runtime structures
4 //! used by the `wasmtime` crate. This additionally defines primitives of
5 //! compilation and what compilers are expected to emit.
6 //!
7 //! If you don't already know what this crate is you probably want to use
8 //! `wasmtime`, not this crate.
9 
10 #![deny(missing_docs)]
11 #![warn(clippy::cast_sign_loss)]
12 #![no_std]
13 
14 #[cfg(feature = "std")]
15 #[macro_use]
16 extern crate std;
17 extern crate alloc;
18 
19 pub mod collections;
20 pub mod prelude;
21 
22 mod address_map;
23 mod frame_table;
24 #[macro_use]
25 mod builtin;
26 mod demangling;
27 mod ext;
28 mod gc;
29 mod hostcall;
30 mod key;
31 mod module;
32 mod module_artifacts;
33 mod module_types;
34 pub mod obj;
35 mod ref_bits;
36 mod scopevec;
37 mod stack_map;
38 mod stack_switching;
39 mod string_pool;
40 mod trap_encoding;
41 mod tunables;
42 mod types;
43 mod vmoffsets;
44 mod wasm_error;
45 
46 pub use self::ext::*;
47 pub use crate::address_map::*;
48 pub use crate::builtin::*;
49 pub use crate::demangling::*;
50 pub use crate::frame_table::*;
51 pub use crate::gc::*;
52 pub use crate::hostcall::*;
53 pub use crate::key::*;
54 pub use crate::module::*;
55 pub use crate::module_artifacts::*;
56 pub use crate::module_types::*;
57 pub use crate::ref_bits::*;
58 pub use crate::scopevec::ScopeVec;
59 pub use crate::stack_map::*;
60 pub use crate::stack_switching::*;
61 pub use crate::string_pool::{Atom, StringPool};
62 pub use crate::trap_encoding::*;
63 pub use crate::tunables::*;
64 pub use crate::types::*;
65 pub use crate::vmoffsets::*;
66 pub use crate::wasm_error::*;
67 pub use object;
68 
69 pub use wasmparser;
70 
71 #[cfg(feature = "compile")]
72 mod compile;
73 #[cfg(feature = "compile")]
74 pub use crate::compile::*;
75 
76 #[cfg(feature = "component-model")]
77 pub mod component;
78 #[cfg(all(feature = "component-model", feature = "compile"))]
79 pub mod fact;
80 
81 // Reexport all of these type-level since they're quite commonly used and it's
82 // much easier to refer to everything through one crate rather than importing
83 // one of three and making sure you're using the right one.
84 pub use cranelift_entity::*;
85 
86 // Reexport the error module for convenience.
87 #[doc(inline)]
88 pub use wasmtime_core::error;
89 
90 #[cfg(feature = "anyhow")]
91 pub use self::error::ToWasmtimeResult;
92 
93 pub use wasmtime_core::{alloc::PanicOnOom, undo::Undo};
94 
95 // Only for use with `bindgen!`-generated code.
96 #[doc(hidden)]
97 #[cfg(feature = "anyhow")]
98 pub use anyhow;
99 
100 /// Version number of this crate.
101 pub const VERSION: &str = env!("CARGO_PKG_VERSION");
102