Expand description
Main documentation is in https://github.com/fzyzcjy/flutter_rust_bridge
Modules§
Macros§
- Macro helper to instantiate an
RustOpaque<dyn Trait>
, as Rust does not support custom DSTs on stable. - On WASM,
JsValue
s cannot be shared between scopes but instead can be “transferred”. Rust however is not aware of transferables and therefore cannot capture these values. This macro wraps a closure and returns aTransferClosure
on WASM platforms which will capture these special values, or a normal FnOnce on other platforms. Note that the parameter names must match available variables/bindings from the outer scope.
Structs§
- Similar to the output of catch_unwind, but with extra backtrace
- Arbitrary Dart object, whose type can be even non-encodable and non-transferable.
- An owned permission to join on a task (await its termination).
- Utility for tracking panic backtrace.
- Error when sending message from rust to dart
- Codec that does a simple serialization
- Wrapping a Vec
in this tuple struct will allow into_dart() to send it as a DartNativeExternalTypedData buffer with no copy overhead
Traits§
- Dart
Safe Deprecated - Provide your own handler to customize how to execute your function calls, etc.
- A trait to convert between Rust types and Dart Types that could then be sent to the isolate
- Basically the Into trait.
- An encoded message
Functions§
- Setup defaults that is usually useful for a new project. Surely, you are free to customize everything.
- Spawns a new asynchronous task, returning a
JoinHandle
for it. - Similar to tokio’s
spawn_blocking
, except that you need to provide a second argumnet.
Type Aliases§
- Use this type to represent Dart
dynamic
values - Roughly speaking, just BoxFuture + UnwindSafe.
- The default handler used by the generated code.
- Please refer to
RustAutoOpaque
for doc. - Please refer to
RustOpaque
for doc.
Attribute Macros§
- Attribute to guide code generation.