forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-programs: merge all wasi content generated by wit into the same mod
- Loading branch information
Showing
9 changed files
with
86 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
crates/test-programs/src/bin/cli_serve_authority_and_scheme.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,23 @@ pub mod nn; | |
pub mod preview1; | ||
pub mod sockets; | ||
|
||
wit_bindgen::generate!({ | ||
world: "test-command", | ||
path: "../wasi/wit", | ||
generate_all, | ||
}); | ||
mod cli { | ||
wit_bindgen::generate!({ | ||
path: "../wasi/wit", | ||
world: "wasi:cli/command", | ||
default_bindings_module: "test_programs::wasi", | ||
generate_all, | ||
}); | ||
} | ||
|
||
pub mod proxy { | ||
mod proxy { | ||
wit_bindgen::generate!({ | ||
path: "../wasi-http/wit", | ||
world: "wasi:http/proxy", | ||
default_bindings_module: "test_programs::proxy", | ||
default_bindings_module: "test_programs::wasi", | ||
pub_export_macro: true, | ||
export_macro_name: "_export_proxy", | ||
with: { | ||
"wasi:http/[email protected]": crate::wasi::http::types, | ||
"wasi:http/[email protected]": crate::wasi::http::outgoing_handler, | ||
"wasi:random/[email protected]": crate::wasi::random::random, | ||
"wasi:io/[email protected]": crate::wasi::io::error, | ||
"wasi:io/[email protected]": crate::wasi::io::poll, | ||
|
@@ -30,3 +32,29 @@ pub mod proxy { | |
}, | ||
}); | ||
} | ||
|
||
pub mod wasi { | ||
pub use crate::cli::wasi::*; | ||
|
||
pub mod http { | ||
pub use crate::proxy::wasi::http::*; | ||
pub mod proxy { | ||
pub use crate::proxy::_export_proxy as export; | ||
} | ||
} | ||
|
||
pub mod exports { | ||
// This is required by the `export!` macros of this crate which assume that | ||
// the types it's referring to show up as `exports::wasi::...`. | ||
#[doc(hidden)] | ||
pub mod wasi { | ||
pub use crate::proxy::exports::wasi::*; | ||
} | ||
|
||
pub use crate::proxy::exports::wasi::http; | ||
} | ||
|
||
// These macros are used by recursive invocations of the macro | ||
#[doc(hidden)] | ||
pub use crate::proxy::_export_proxy; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters