Divyansh200102 commented on issue #5427:
URL: https://github.com/apache/shenyu/issues/5427#issuecomment-1951766334
> The method name of Java calling WASM depends on the definition of the
abstract class. More importantly, we use
`org.apache.shenyu.plugin.wasm.api.loader.WasmLoader#getWasmExtern` to obtain
the WASM function. So you can see the WASM function names(that's why are the
rust functions named these names) below:
I think I wasn't able to convey my message properly I do understand why the
rust functions are named the way they are but I was asking that in
`shenyu-plugin/shenyu-plugin-wasm-api/src/test/rust-wasm-plugin/src/lib.rs` in
`lib.rs` the `execute` method which is written in rust and was used for making
plugin(`rust-wasm-plugin`) for `AbstractWasmPlugin`
```rust
#[no_mangle]
pub unsafe extern "C" fn execute(arg_id: i64) {
let mut buf = [0u8; 32];
let buf_ptr = buf.as_mut_ptr() as i64;
eprintln!("rust side-> buffer base address: {}", buf_ptr);
// get arg from java
let len = get_args(arg_id, buf_ptr, buf.len() as i32);
let java_arg = std::str::from_utf8(&buf[..len as usize]).unwrap();
eprintln!("rust side-> recv:{}", java_arg);
// pass rust result to java
let rust_result = "rust result".as_bytes();
let result_ptr = rust_result.as_ptr() as i64;
_ = put_result(arg_id, result_ptr, rust_result.len() as i32);
}
```
was taken from here in the documentation

so I am asking that if i want to make the plugin for
`AbstractShenyuWasmPlugin` I need the `doexecute` method in rust to put in my
`lib.rs` but it's not given in the documentation

so I should I proceed from here? @loongs-zhang
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]