1use crate::AtomType;
2use witx::CoreFuncType;
3
4#[derive(Clone, Debug, PartialEq, Eq)]
5pub struct FuncSignature {
6 pub args: Vec<AtomType>,
7 pub ret: Option<AtomType>,
8}
9
10impl From<CoreFuncType> for FuncSignature {
11 fn from(m: CoreFuncType) -> FuncSignature {
12 FuncSignature {
13 args: m.args.iter().map(|a| a.repr()).collect(),
14 ret: m.ret.map(|r| r.repr()),
15 }
16 }
17}
18
19#[derive(Clone, Debug, PartialEq, Eq)]
20pub struct ImportFunc {
21 pub module: String,
22 pub field: String,
23 pub ty: FuncSignature,
24}