1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//! Linera Witty
//!
//! This crate allows generating [WIT] files and host side code to interface with WebAssembly guests
//! that adhere to the [WIT] interface format. The source of truth for the generated code and WIT
//! files is the Rust source code.
//!
//! [WIT]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md

#![deny(missing_docs)]

#[macro_use]
mod macro_utils;

mod exported_function_interface;
mod imported_function_interface;
mod memory_layout;
mod primitive_types;
mod runtime;
#[cfg(with_testing)]
pub mod test;
mod type_traits;
mod util;
pub mod wit_generation;

pub use frunk::{hlist, hlist::HList, hlist_pat, HCons, HList, HNil};
#[cfg(with_wit_export)]
pub use linera_witty_macros::wit_export;
#[cfg(with_macros)]
pub use linera_witty_macros::{wit_import, WitLoad, WitStore, WitType};

#[cfg(with_wasmer)]
pub use self::runtime::wasmer;
#[cfg(with_wasmtime)]
pub use self::runtime::wasmtime;
#[cfg(with_testing)]
pub use self::runtime::{MockExportedFunction, MockInstance, MockResults, MockRuntime};
pub use self::{
    exported_function_interface::{ExportFunction, ExportTo, ExportedFunctionInterface},
    imported_function_interface::ImportedFunctionInterface,
    memory_layout::{JoinFlatLayouts, Layout},
    runtime::{
        GuestPointer, Instance, InstanceWithFunction, InstanceWithMemory, Memory, Runtime,
        RuntimeError, RuntimeMemory,
    },
    type_traits::{RegisterWitTypes, WitLoad, WitStore, WitType},
    util::{Merge, Split},
};