linera_witty/
lib.rs

1// Copyright (c) Zefchain Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Linera Witty
5//!
6//! This crate allows generating [WIT] files and host side code to interface with WebAssembly guests
7//! that adhere to the [WIT] interface format. The source of truth for the generated code and WIT
8//! files is the Rust source code.
9//!
10//! [WIT]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md
11
12#![deny(missing_docs)]
13
14#[macro_use]
15mod macro_utils;
16
17mod exported_function_interface;
18mod imported_function_interface;
19mod memory_layout;
20mod primitive_types;
21mod runtime;
22#[cfg(with_testing)]
23pub mod test;
24mod type_traits;
25mod util;
26pub mod wit_generation;
27
28pub use frunk::{hlist, hlist::HList, hlist_pat, HCons, HList, HNil};
29#[cfg(with_wit_export)]
30pub use linera_witty_macros::wit_export;
31#[cfg(with_macros)]
32pub use linera_witty_macros::{wit_import, WitLoad, WitStore, WitType};
33
34#[cfg(with_wasmer)]
35pub use self::runtime::wasmer;
36#[cfg(with_wasmtime)]
37pub use self::runtime::wasmtime;
38#[cfg(with_testing)]
39pub use self::runtime::{MockExportedFunction, MockInstance, MockResults, MockRuntime};
40pub use self::{
41    exported_function_interface::{ExportFunction, ExportTo, ExportedFunctionInterface},
42    imported_function_interface::ImportedFunctionInterface,
43    memory_layout::{JoinFlatLayouts, Layout},
44    runtime::{
45        GuestPointer, Instance, InstanceWithFunction, InstanceWithMemory, Memory, Runtime,
46        RuntimeError, RuntimeMemory,
47    },
48    type_traits::{RegisterWitTypes, WitLoad, WitStore, WitType},
49    util::{Merge, Split},
50};