[][src]Crate allo_isolate

Allo Isolate Run Multithreaded Rust along with Dart VM (in isolate).

Since you can't call into dart from other threads other than the main thread, that holds our rust code from beaing multithreaded, the way that can be done is using Dart Isolate by creating an isolate, send its NativePort to Rust side, then rust is freely could run and send the result back on that port.

Interacting with Dart VM directly isn't that easy, that is why we created that library, it provides IntoDart trait to convert between Rust data types and Dart Types, and by default it is implemented for all common rust types.


See flutterust and how we used it in the scrap package to create a webscrapper using Rust and Flutter.





Simple wrapper around the Dart Isolate Port, nothing else.



A trait to convert between Rust types and Dart Types that could then be sended to the isolate



Stores the function pointer of Dart_PostCObject, this only should be called once at the start up of the Dart/Flutter Application. it is exported and marked as #[no_mangle].