From e52652b2088a61ef512e38e185a2edaa9f678a6c Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 16 Apr 2025 21:13:23 -0700 Subject: [PATCH] build: use Result instead of SendResult --- src/build/caller_utils_generator.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/build/caller_utils_generator.rs b/src/build/caller_utils_generator.rs index edcf9ce0..05578caf 100644 --- a/src/build/caller_utils_generator.rs +++ b/src/build/caller_utils_generator.rs @@ -384,8 +384,8 @@ fn generate_async_function(signature: &SignatureStruct) -> String { ) + ¶ms.join(", ") }; - // Wrap the return type in SendResult - let wrapped_return_type = format!("SendResult<{}>", return_type); + // Wrap the return type in a Result<_, AppSendError> + let wrapped_return_type = format!("Result<{}, AppSendError>", return_type); // For HTTP endpoints, generate commented-out implementation if signature.attr_type == "http" { @@ -427,7 +427,7 @@ fn generate_async_function(signature: &SignatureStruct) -> String { }; return format!( - "// /// Generated stub for `{}` {} RPC call\n// /// HTTP endpoint - uncomment to implement\n// pub async fn {}({}) -> {} {{\n// // TODO: Implement HTTP endpoint\n// SendResult::Success({})\n// }}", + "// /// Generated stub for `{}` {} RPC call\n// /// HTTP endpoint - uncomment to implement\n// pub async fn {}({}) -> {} {{\n// // TODO: Implement HTTP endpoint\n// Ok({})\n// }}", signature.function_name, signature.attr_type, full_function_name, @@ -496,7 +496,7 @@ process_macros = "0.1.0" futures-util = "0.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -hyperware_app_common = { git = "https://github.com/hyperware-ai/hyperprocess-macro", rev = "df8f395" } +hyperware_app_common = { git = "https://github.com/hyperware-ai/hyperprocess-macro", rev = "a485cd1" } once_cell = "1.20.2" futures = "0.3" uuid = { version = "1.0" } @@ -635,7 +635,7 @@ crate-type = ["cdylib", "lib"] lib_rs.push_str("/// Generated caller utilities for RPC function stubs\n\n"); // Add global imports - lib_rs.push_str("pub use hyperware_app_common::SendResult;\n"); + lib_rs.push_str("pub use hyperware_app_common::AppSendError;\n"); lib_rs.push_str("pub use hyperware_app_common::send;\n"); lib_rs.push_str("use hyperware_app_common::hyperware_process_lib as hyperware_process_lib;\n"); lib_rs.push_str("use hyperware_process_lib::{Address, Request};\n");