summaryrefslogtreecommitdiff
path: root/crates/types
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2023-12-01 14:06:05 +0100
committerHenry Gressmann <mail@henrygressmann.de>2023-12-01 14:06:05 +0100
commitb9b517375c1f8c50c0096ef61d2395decf071914 (patch)
treec524ed3cd702a2c7b261e8bdfac59887b1ca5c4e /crates/types
parent871398ff821255debdbd9452e46ca55a05e8cb92 (diff)
chore: move TinyWasmModule to types
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/types')
-rw-r--r--crates/types/Cargo.toml2
-rw-r--r--crates/types/src/lib.rs15
2 files changed, 17 insertions, 0 deletions
diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml
index 83263a6..fa2fc6e 100644
--- a/crates/types/Cargo.toml
+++ b/crates/types/Cargo.toml
@@ -5,7 +5,9 @@ edition="2021"
[dependencies]
tracing={version="0.1.38", default-features=false} # logging
+rkyv={version="0.7", optional=true, default-features=false}
[features]
default=["std"]
std=[]
+serialize=["dep:rkyv"]
diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs
index e68efe7..e793b26 100644
--- a/crates/types/src/lib.rs
+++ b/crates/types/src/lib.rs
@@ -3,6 +3,21 @@ extern crate alloc;
mod instructions;
pub use instructions::*;
+pub struct TinyWasmModule {
+ pub version: Option<u16>,
+ pub start_func: Option<u32>,
+
+ pub types: Option<Box<[FuncType]>>,
+ pub funcs: Option<Box<[Function]>>,
+ pub exports: Option<Box<[Export]>>,
+ // pub tables: Option<TableType>,
+ // pub memories: Option<MemoryType>,
+ // pub globals: Option<GlobalType>,
+ // pub elements: Option<ElementSectionReader<'a>>,
+ // pub imports: Option<ImportSectionReader<'a>>,
+ // pub data_segments: Option<DataSectionReader<'a>>,
+}
+
/// A WebAssembly value.
/// See https://webassembly.github.io/spec/core/syntax/types.html#value-types
#[derive(Debug, Clone, PartialEq)]