Crate flutter_rust_bridge

Source
Expand description

Modules§

handler

Macros§

opaque_dyn
Macro helper to instantiate an RustOpaque<dyn Trait>, as Rust does not support custom DSTs on stable.
transfer
On WASM, JsValues 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 a TransferClosure 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§

CatchUnwindWithBacktrace
Similar to the output of catch_unwind, but with extra backtrace
Dart2RustMessageSse
DartOpaque
Arbitrary Dart object, whose type can be even non-encodable and non-transferable.
JoinHandle
An owned permission to join on a task (await its termination).
PanicBacktrace
Utility for tracking panic backtrace.
Rust2DartSendError
Error when sending message from rust to dart
SimpleAsyncRuntime
SimpleThreadPool
SseCodec
Codec that does a simple serialization
ZeroCopyBuffer
Wrapping a Vec in this tuple struct will allow into_dart() to send it as a DartNativeExternalTypedData buffer with no copy overhead

Traits§

BaseAsyncRuntime
BaseCodec
BaseThreadPool
DartSafeDeprecated
Handler
Provide your own handler to customize how to execute your function calls, etc.
IntoDart
A trait to convert between Rust types and Dart Types that could then be sent to the isolate
IntoIntoDart
Basically the Into trait.
Rust2DartMessageTrait
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 current LocalSet or LocalRuntime.

Type Aliases§

DartAbi
DartDynamic
Use this type to represent Dart dynamic values
DartFnFuture
Roughly speaking, just BoxFuture + UnwindSafe.
DefaultHandler
The default handler used by the generated code.
RustAutoOpaqueNom
Please refer to RustAutoOpaque for doc.
RustOpaqueNom
Please refer to RustOpaque for doc.

Attribute Macros§

frb
Attribute to guide code generation.