Skip to content

Commit 1eb7616

Browse files
authored
move wasip2 re-export under pub mod __internal (#91)
1 parent 431d444 commit 1eb7616

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

macro/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ pub fn attr_macro_http_server(_attr: TokenStream, item: TokenStream) -> TokenStr
126126
quote! {
127127
struct TheServer;
128128

129-
impl ::wstd::wasip2::exports::http::incoming_handler::Guest for TheServer {
129+
impl ::wstd::__internal::wasip2::exports::http::incoming_handler::Guest for TheServer {
130130
fn handle(
131-
request: ::wstd::wasip2::http::types::IncomingRequest,
132-
response_out: ::wstd::wasip2::http::types::ResponseOutparam
131+
request: ::wstd::__internal::wasip2::http::types::IncomingRequest,
132+
response_out: ::wstd::__internal::wasip2::http::types::ResponseOutparam
133133
) {
134134
#(#attrs)*
135135
#vis async fn __run(#inputs) #output {
@@ -146,7 +146,7 @@ pub fn attr_macro_http_server(_attr: TokenStream, item: TokenStream) -> TokenStr
146146
}
147147
}
148148

149-
::wstd::wasip2::http::proxy::export!(TheServer with_types_in ::wstd::wasip2);
149+
::wstd::__internal::wasip2::http::proxy::export!(TheServer with_types_in ::wstd::__internal::wasip2);
150150

151151
// Provide an actual function named `main`.
152152
//

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ pub use wstd_macro::attr_macro_http_server as http_server;
7070
pub use wstd_macro::attr_macro_main as main;
7171
pub use wstd_macro::attr_macro_test as test;
7272

73-
// Re-export the wasi crate for use by the `http_server` macro.
73+
// Re-export the wasip2 crate for use only by `wstd-macro` macros. The proc
74+
// macros need to generate code that uses these definitions, but we don't want
75+
// to treat it as part of our public API with regards to semver, so we keep it
76+
// under `__internal` as well as doc(hidden) to indicate it is private.
7477
#[doc(hidden)]
75-
pub use wasip2;
78+
pub mod __internal {
79+
pub use wasip2;
80+
}
7681

7782
pub mod prelude {
7883
pub use crate::future::FutureExt as _;

0 commit comments

Comments
 (0)