diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-10-27 17:59:19 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-27 17:59:19 +0800 |
| commit | 5e150adf0e3d8b3843779eddd83469d1b1ba84bc (patch) | |
| tree | aedbd6cd10757da9c9d401a818ed1471f377d54b /crates/system_action/action_macros/src/lib.rs | |
| parent | 49ad7a152cf849c8d91ee6b686da31f9c252f77c (diff) | |
| parent | 368687c943a13427b5338a30fb7b55558420f4de (diff) | |
Merge pull request #26 from JustEnoughVCS/jvcs_dev
Jvcs dev
Diffstat (limited to 'crates/system_action/action_macros/src/lib.rs')
| -rw-r--r-- | crates/system_action/action_macros/src/lib.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crates/system_action/action_macros/src/lib.rs b/crates/system_action/action_macros/src/lib.rs index ce50073..4c03b63 100644 --- a/crates/system_action/action_macros/src/lib.rs +++ b/crates/system_action/action_macros/src/lib.rs @@ -64,9 +64,10 @@ fn generate_action_struct(input_fn: ItemFn, _is_local: bool) -> proc_macro2::Tok #fn_vis async fn #proc_this_action( pool: &action_system::action_pool::ActionPool, - ctx: action_system::action::ActionContext, + mut ctx: action_system::action::ActionContext, #arg_param_name: #arg_type ) -> Result<#return_type, tcp_connection::error::TcpTargetError> { + ctx.set_is_remote_action(!#_is_local); let args_json = serde_json::to_string(&#arg_param_name) .map_err(|e| { tcp_connection::error::TcpTargetError::Serialization(e.to_string()) @@ -121,11 +122,12 @@ fn validate_function_signature(fn_sig: &syn::Signature) { if let syn::Type::Path(type_path) = return_type.as_ref() { if let Some(segment) = type_path.path.segments.last() - && segment.ident != "Result" { - panic!( - "Expected Action function to return Result<T, TcpTargetError>, but found different return type" - ); - } + && segment.ident != "Result" + { + panic!( + "Expected Action function to return Result<T, TcpTargetError>, but found different return type" + ); + } } else { panic!( "Expected Action function to return Result<T, TcpTargetError>, but found no return type" |
