linera_wasmer_compiler/
lib.rs1#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
9#![warn(unused_import_braces)]
10#![cfg_attr(not(feature = "std"), no_std)]
11#![allow(clippy::new_without_default, clippy::upper_case_acronyms)]
12#![warn(
13 clippy::float_arithmetic,
14 clippy::mut_mut,
15 clippy::nonminimal_bool,
16 clippy::map_unwrap_or,
17 clippy::print_stdout,
18 clippy::unicode_not_nfc,
19 clippy::use_self
20)]
21#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
22
23#[cfg(all(feature = "std", feature = "core"))]
24compile_error!(
25 "The `std` and `core` features are both enabled, which is an error. Please enable only once."
26);
27
28#[cfg(all(not(feature = "std"), not(feature = "core")))]
29compile_error!("Both the `std` and `core` features are disabled. Please enable one of them.");
30
31#[cfg(feature = "core")]
32extern crate alloc;
33
34#[allow(unused_imports)]
35mod lib {
36 #[cfg(feature = "core")]
37 pub mod std {
38 pub use alloc::{borrow, boxed, str, string, sync, vec};
39 pub use core::fmt;
40 pub use hashbrown as collections;
41 }
42
43 #[cfg(feature = "std")]
44 pub mod std {
45 pub use std::{borrow, boxed, collections, fmt, str, string, sync, vec};
46 }
47}
48
49mod engine;
50mod traits;
51
52pub use crate::engine::*;
53pub use crate::traits::*;
54
55mod artifact_builders;
56
57pub use self::artifact_builders::*;
58
59#[cfg(feature = "translator")]
60mod compiler;
61
62#[cfg(feature = "translator")]
63#[macro_use]
64mod translator;
65#[cfg(feature = "translator")]
66pub use crate::compiler::{Compiler, CompilerConfig};
67#[cfg(feature = "translator")]
68pub use crate::translator::{
69 from_binaryreadererror_wasmerror, translate_module, wpheaptype_to_type, wptype_to_type,
70 FunctionBinaryReader, FunctionBodyData, FunctionMiddleware, MiddlewareBinaryReader,
71 MiddlewareReaderState, ModuleEnvironment, ModuleMiddleware, ModuleMiddlewareChain,
72 ModuleTranslationState,
73};
74
75pub use wasmer_types::{Addend, CodeOffset, Features};
76
77#[cfg(feature = "translator")]
78pub use wasmparser;
80
81pub const VERSION: &str = env!("CARGO_PKG_VERSION");