[−][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.
Example
See flutterust
and how we used it in the scrap
package to create a webscrapper using Rust and Flutter.
Modules
ffi |
Structs
Isolate | Simple wrapper around the Dart Isolate Port, nothing else. |
Traits
IntoDart | A trait to convert between Rust types and Dart Types that could then be sended to the isolate |
Functions
store_dart_post_cobject⚠ | Stores the function pointer of |