xref: /wasmtime-44.0.1/crates/c-api/src/types.rs (revision a7f592a0)
1 use wasmtime::Limits;
2 
3 #[repr(C)]
4 #[derive(Clone)]
5 pub struct wasm_limits_t {
6     pub min: u32,
7     pub max: u32,
8 }
9 
10 impl wasm_limits_t {
11     pub(crate) fn to_wasmtime(&self) -> Limits {
12         let max = if self.max == u32::max_value() {
13             None
14         } else {
15             Some(self.max)
16         };
17         Limits::new(self.min, max)
18     }
19 }
20 
21 mod export;
22 mod r#extern;
23 mod func;
24 mod global;
25 mod import;
26 mod instance;
27 mod memory;
28 mod module;
29 mod table;
30 mod val;
31 pub use self::export::*;
32 pub use self::func::*;
33 pub use self::global::*;
34 pub use self::import::*;
35 pub use self::instance::*;
36 pub use self::memory::*;
37 pub use self::module::*;
38 pub use self::r#extern::*;
39 pub use self::table::*;
40 pub use self::val::*;
41