Closed thaodt closed 1 year ago
I forget whether type A = B
syntax works or not. Try to change it like struct Sha256Hash([u8; 32])
to see whether this is the problem
change into struct Sha256Hash([u8; 32])
it seems working. But Im getting the error below in bridge_generated.rs
:
fn wire_get_latest_block_hash__static_method__WalletDBWrapper_impl(port_: MessagePort) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap(
WrapInfo {
debug_name: "get_latest_block_hash__static_method__WalletDBWrapper",
port: Some(port_),
mode: FfiCallMode::Normal,
},
move || move |task_callback| WalletDBWrapper::get_latest_block_hash(), // <----- expected Result<{unknown}, Error>, found Result<Sha256Hash, String>
)
}
Actually it should expect Result<Sha256Hash, String>
, right?
is common
same or different crate? https://cjycode.com/flutter_rust_bridge/feature/lang_external.html
is
common
same or different crate? https://cjycode.com/flutter_rust_bridge/feature/lang_external.html
hmm its weird because all vars, fns which I imported from common
worked fine. Lemme check again. I will close this issue because the original problem is resolved.
@fzyzcjy just curious. Is there any reason we didn't support type A = B
? any problems with Dart code conversion or from Rust FFI?
No any problem indeed. Feel free to PR and I am looking forward to merge it! :)
No any problem indeed. Feel free to PR and I am looking forward to merge it! :)
Any hints for this? I'd like to give it a try. Also, are you planning setup a discord server for discussion? :smile:
Any hints for this
parser.rs
Also, are you planning setup a discord server for discussion? 😄
Just ask here - I am on github and reply (more) quickly :)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Describe the bug
My
native/src/api.rs
:and the codegen seems didn't work. The codegen error in the next section.
The Sha256Hash type is defined:
pub type Sha256Hash = [u8; 32];
Its just a fixed-size array in Rust.Codegen logs with
RUST_LOG=debug
environment variableTo Reproduce
Just run the command codegen above.
Expected behavior
function output signature should be parsed.
Generated binding code
No response
OS
Kernel 5.15.76-1-MANJARO
Version of
flutter_rust_bridge_codegen
1.49.1
Flutter info
Version of
clang++
14.0.6
Version of
ffigen
6.0.1
Additional context
Link to #831.