Skip to content

Commit 44dac76

Browse files
committed
refactor(io): migrate IO onto scoped lifecycle
1 parent f6f0040 commit 44dac76

14 files changed

Lines changed: 1683 additions & 518 deletions

File tree

build.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,20 @@ fn write_generated_file(path: &Path, contents: &str) {
229229
fn builtin_source_specs(namespaces: &[NamespaceDecl]) -> Vec<SourceSpec> {
230230
namespaces
231231
.iter()
232-
.map(|namespace| SourceSpec {
233-
path: format!("src/builtins/runtime/{}.rs", namespace.module),
234-
module: namespace.module.clone(),
235-
category: SourceCategory::NamespacedBuiltin,
232+
.map(|namespace| {
233+
// At this layer the `io` namespace maps directly to the blocking
234+
// backend; the async/blocking split is introduced later with the
235+
// host async execution layer.
236+
let path = if namespace.module == "io" {
237+
"src/builtins/runtime/io/blocking.rs".to_string()
238+
} else {
239+
format!("src/builtins/runtime/{}.rs", namespace.module)
240+
};
241+
SourceSpec {
242+
path,
243+
module: namespace.module.clone(),
244+
category: SourceCategory::NamespacedBuiltin,
245+
}
236246
})
237247
.collect()
238248
}

pd-host-function/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ fn generate_vm_wrapper(
223223

224224
Ok(quote! {
225225
#[allow(dead_code)]
226-
pub(super) fn #wrapper_name(#(#imm_wrapper_params),*) -> #wrapper_output {
226+
pub(crate) fn #wrapper_name(#(#imm_wrapper_params),*) -> #wrapper_output {
227227
#(#imm_extract_stmts)*
228228
#call_expr
229229
}
230230

231231
#[allow(dead_code)]
232-
pub(super) fn #mutable_wrapper_name(#(#mut_wrapper_params),*) -> #wrapper_output {
232+
pub(crate) fn #mutable_wrapper_name(#(#mut_wrapper_params),*) -> #wrapper_output {
233233
#(#mut_extract_stmts)*
234234
#call_expr
235235
}

0 commit comments

Comments
 (0)