Closed TheTharin closed 2 months ago
Hi there :)
This problem should have been fixed in Rinf 6.8.0. Would you try upgrading Rinf and try running the app?
I've upgraded to Rinf 6.8.0, but now I get these errors:
lib.rs:
rinf::write_interface!();
mismatched types
expected enum `std::option::Option<std::vec::Vec<_>>`
found struct `std::vec::Vec<_>`
messages/my_message.rs
use rinf::SharedCell;
unresolved import `rinf::SharedCell`
no `SharedCell` in the root
UPD:
I think I get why it's throwing me these errors, rinf v6.8.0
is not present in cargo packages list, so it always defaults to v6.12.0
for me:
Downloaded rinf v6.12.1
Okay, specifiying it that way worked:
rinf = { git = "https://github.com/cunarist/rinf.git", tag = 'v6.7.0' }
tokio_with_wasm = "0.4.3"
I decided to fall back to rustc 1.77.2
and rinf 6.7.0
for the time being.
That error message happens when you need to run rinf message
with the newer version. Message channels are becoming more efficient under the hood as version increases.
Would you try rinf message
with the newest Rind version if you don't mind?
Welp, thanks for your answers, as I said, I fell back to 6.7.0 and regenerated the message, everything seemed to start working, except for one thing:
Only one send_signal_to_dart
worked at a time, and any other subsequent rust code didn't run:
println!("Hello"); // this line runs
SceneActionsChange { actions }.send_signal_to_dart(None); // this line runs (I see the message on the Dart side appear in the Stream
println!("World"); // this line doesn't run
So I decided to instead switch to rustc 1.78.0
and rinf 6.21.1
and see if it fixes the issue.
1) I've updated both pubspec.yaml Rinf to 6.12.1
2) and cargo Rinf to 6.12.1
3) + installed a new rinf v.6.12.1
binary
4) removed the generated messages and re-ran rinf message
5) changed the code a bit to remove unnecessary Blobs from send_signal_to_dart()
call
Now I get only one error about:
rinf::write_interface!();
dereferencing a raw pointer and not being marked unsafe.
Everything works fine aside this warning in my VSCode, the compilation process works.
Oh, that error was solved a couple of days ago with the PR below:
Rinf 6.13 will solve that error. It will be relased in a few days. Thanks for your patience.
There is one last thing:
It seems that tokio_with_wasm
crate stopped using tokio
with time
feature. I use it for my tests to wait some time for the events to be handled. I know it's a different crate, but as we're still here in this thread, would you be so kind to check into that as well?
Thank you very much for your answers!
From tokio_with_wasm
0.5.0, you need to import tokio_with_wasm::alias as tokio
, not tokio_with_wasm::tokio
. Those features including time
remain unchanged(only more efficient). The linked section below will explain things in more detail:
You might need to add time
feature at Cargo.toml
, too.
Oh, I didn't realise I had to use tokio
alongside tokio_with_wasm
now in my dependencies.
Now it works fine, thanks!
Have a wonderful day!
I hope every library maintainer was as noob friendly as you are :D
Report
send_signal_to_dart
fails withunsafe precondition(s) violated: NonNull::new_unchecked requires that the pointer is non-null
on1.78.0
toolchain. Works OK on1.77.2
toolchain.Here's a full stack trace:
Steps to Reproduce
1) add
to your tests module
2) call
in your test.
3) call
in your test.
System Information
Please provide the output from the command below, using markdown codeblock syntax.