marine_core/module/
mod.rs

1/*
2 * Copyright 2020 Fluence Labs Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17mod exports;
18mod marine_module;
19mod wit_function;
20mod wit_instance;
21mod type_converters;
22
23use marine_wasm_backend_traits::WValue;
24
25pub use wit_instance::MRecordTypes;
26
27pub use wasmer_it::IType;
28pub use wasmer_it::IRecordType;
29pub use wasmer_it::ast::FunctionArg as IFunctionArg;
30pub use wasmer_it::IValue;
31pub use wasmer_it::from_interface_values;
32pub use wasmer_it::to_interface_value;
33
34use serde::Serialize;
35use serde::Deserialize;
36use std::sync::Arc;
37
38/// Represent a function type inside Marine module.
39#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)]
40pub struct MFunctionSignature {
41    pub name: Arc<String>,
42    pub arguments: Arc<Vec<IFunctionArg>>,
43    pub outputs: Arc<Vec<IType>>,
44}
45
46pub(crate) use marine_module::MModule;
47
48// types that often used together
49pub(crate) mod wit_prelude {
50    pub(super) use super::wit_instance::ITInstance;
51    pub(super) use super::exports::ITExport;
52    pub(super) use crate::MError;
53    pub(super) use super::wit_function::WITFunction;
54}