fce_wit_parser/
lib.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#![warn(rust_2018_idioms)]
17#![deny(
18    dead_code,
19    nonstandard_style,
20    unused_imports,
21    unused_mut,
22    unused_variables,
23    unused_unsafe,
24    unreachable_patterns
25)]
26
27mod custom;
28mod deleter;
29mod embedder;
30mod errors;
31mod extractor;
32
33pub use errors::WITParserError;
34
35pub use deleter::delete_wit_section;
36pub use deleter::delete_wit_section_from_file;
37
38pub use embedder::embed_wit;
39pub use embedder::embed_text_wit;
40
41pub use extractor::extract_wit_from_module;
42pub use extractor::extract_version_from_module;
43pub use extractor::extract_text_wit;
44pub use extractor::module_interface;
45pub use extractor::module_raw_interface;
46
47pub mod interface {
48    pub use crate::extractor::ServiceInterface;
49    pub use crate::extractor::RecordType;
50    pub use crate::extractor::FunctionSignature;
51
52    pub use crate::extractor::FCEModuleInterface;
53    pub use crate::extractor::FCERecordTypes;
54    pub use crate::extractor::FCEFunctionSignature;
55    pub mod it {
56        pub use wasmer_wit::IType;
57        pub use wasmer_wit::ast::FunctionArg as IFunctionArg;
58        pub use wasmer_wit::IRecordType;
59        pub use wasmer_wit::IRecordFieldType;
60    }
61}
62
63pub(crate) type Result<T> = std::result::Result<T, WITParserError>;