Skip to content

Commit 3bab213

Browse files
committed
unignore bindings.rs
1 parent c73382b commit 3bab213

File tree

3 files changed

+92
-7
lines changed

3 files changed

+92
-7
lines changed

hermes/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ target/
77
# This is an application so allow Cargo lock for now.
88
!Cargo.lock
99

10-
# This file is only used for local development/debugging
11-
bindings.rs
12-
1310
# These are backup files generated by rustfmt
1411
**/*.rs.bk
1512

hermes/apps/athena/Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
//! Hermes bindings generated with [`::wit_bindgen`].
2+
//! They can be reused when using `share` keyword of [`bindings_generate`] macro.
3+
4+
/// Re-exported [`::wit-bindgen`] crate, so that [`bindings_generate`] is self-reliant.
5+
#[doc(hidden)]
6+
pub use wit_bindgen;
7+
8+
wit_bindgen::generate!({
9+
world: "hermes",
10+
path: "../../../../wasm/wasi/wit",
11+
disable_custom_section_link_helpers: true,
12+
generate_all,
13+
});
14+
15+
/// See [crate-level](crate) documentation.
16+
#[macro_export]
17+
macro_rules! bindings_generate {
18+
({
19+
world: $world:literal,
20+
path: $path:literal,
21+
inline: $inline:literal,
22+
$(with: {$($with_wit:literal: $with_path:path),* $(,)? },)?
23+
share: [] $(,)?
24+
}) => {
25+
::shared::bindings::wit_bindgen::generate!({
26+
runtime_path: "::shared::bindings::wit_bindgen::rt",
27+
world: $world,
28+
path: $path,
29+
inline: $inline,
30+
$(with: { $($with_wit: $with_path,)* },)?
31+
generate_all,
32+
});
33+
};
34+
({
35+
world: $world:literal,
36+
path: $path:literal,
37+
inline: $inline:literal,
38+
$(with: {$($with_wit:literal: $with_path:path),* $(,)? },)?
39+
share: ["hermes:cardano" $(, $share:tt)* $(,)?] $(,)?
40+
}) => {
41+
$crate::bindings_generate!({
42+
world: $world,
43+
path: $path,
44+
inline: $inline,
45+
with: {
46+
$($($with_wit: $with_path,)*)?
47+
"hermes:binary/api": ::shared::bindings::hermes::binary::api,
48+
"hermes:cbor/api": ::shared::bindings::hermes::cbor::api,
49+
"hermes:hash/api": ::shared::bindings::hermes::hash::api,
50+
"hermes:cardano/api": ::shared::bindings::hermes::cardano::api,
51+
},
52+
share: [$($share),*],
53+
});
54+
};
55+
({
56+
world: $world:literal,
57+
path: $path:literal,
58+
inline: $inline:literal,
59+
$(with: {$($with_wit:literal: $with_path:path),* $(,)? },)?
60+
share: ["hermes:logging" $(, $share:tt)* $(,)?] $(,)?
61+
}) => {
62+
$crate::bindings_generate!({
63+
world: $world,
64+
path: $path,
65+
inline: $inline,
66+
with: {
67+
$($($with_wit: $with_path,)*)?
68+
"hermes:logging/api": ::shared::bindings::hermes::logging::api,
69+
"hermes:json/api": ::shared::bindings::hermes::json::api,
70+
},
71+
share: [$($share),*],
72+
});
73+
};
74+
({
75+
world: $world:literal,
76+
path: $path:literal,
77+
inline: $inline:literal,
78+
$(with: {$($with_wit:literal: $with_path:path),* $(,)? },)?
79+
share: ["hermes:sqlite" $(, $share:tt)* $(,)?] $(,)?
80+
}) => {
81+
$crate::bindings_generate!({
82+
world: $world,
83+
path: $path,
84+
inline: $inline,
85+
with: {
86+
$($($with_wit: $with_path,)*)?
87+
"hermes:sqlite/api": ::shared::bindings::hermes::sqlite::api,
88+
},
89+
share: [$($share),*]
90+
});
91+
};
92+
}

0 commit comments

Comments
 (0)