Expand description
Main documentation is in https://github.com/fzyzcjy/flutter_rust_bridge
Modules§
Macros§
- opaque_
dyn - Macro helper to instantiate an
RustOpaque<dyn Trait>
, as Rust does not support custom DSTs on stable. - transfer
- 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§
- Catch
Unwind With Backtrace - Similar to the output of catch_unwind, but with extra backtrace
- Dart2
Rust Message Sse - Dart
Opaque - Arbitrary Dart object, whose type can be even non-encodable and non-transferable.
- Join
Handle - An owned permission to join on a task (await its termination).
- Panic
Backtrace - Utility for tracking panic backtrace.
- Rust2
Dart Send Error - Error when sending message from rust to dart
- Simple
Async Runtime - Simple
Thread Pool - SseCodec
- Codec that does a simple serialization
- Zero
Copy Buffer - Wrapping a Vec
in this tuple struct will allow into_dart() to send it as a DartNativeExternalTypedData buffer with no copy overhead
Traits§
- Base
Async Runtime - Base
Codec - Base
Thread Pool - Dart
Safe Deprecated - Handler
- Provide your own handler to customize how to execute your function calls, etc.
- Into
Dart - A trait to convert between Rust types and Dart Types that could then be sent to the isolate
- Into
Into Dart - Basically the Into trait.
- Rust2
Dart Message Trait - An encoded message
Functions§
- setup_
default_ user_ utils - Setup defaults that is usually useful for a new project. Surely, you are free to customize everything.
- spawn
- Spawns a new asynchronous task, returning a
JoinHandle
for it. - spawn_
blocking_ with - Similar to tokio’s
spawn_blocking
, except that you need to provide a second argumnet. - spawn_
local - Spawns a
!Send
future on the currentLocalSet
orLocalRuntime
.
Type Aliases§
- DartAbi
- Dart
Dynamic - Use this type to represent Dart
dynamic
values - Dart
FnFuture - Roughly speaking, just BoxFuture + UnwindSafe.
- Default
Handler - The default handler used by the generated code.
- Rust
Auto Opaque Nom - Please refer to
RustAutoOpaque
for doc. - Rust
Opaque Nom - Please refer to
RustOpaque
for doc.
Attribute Macros§
- frb
- Attribute to guide code generation.